Skip to content

fix(mobile): stop alerting that shared content vanished after sending it - #11487

Merged
juliusmarminge merged 1 commit into
share-fix/hermes-to-reversedfrom
share-fix/send-unavailable-alert
Sep 13, 2026
Merged

fix(mobile): stop alerting that shared content vanished after sending it#11487
juliusmarminge merged 1 commit into
share-fix/hermes-to-reversedfrom
share-fix/send-unavailable-alert

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Sep 13, 2026

Copy link
Copy Markdown
Member

After sending a task that came in through the share sheet, the app raised "Shared content unavailable — the shared content is no longer in the inbox" even though the task had sent fine.

Since #10435, sending clears the composer draft synchronously but defers the navigation by a frame. The share import effect re-runs in that frame: the draft's importedShareIds receipt is gone with the draft, the inbox entry was consumed during the import, so the share reads as unavailable.

The screen now remembers the share it consumed and treats it as imported for the rest of its life, independent of the draft receipt.

Verification

Behavioral, no visual change (an alert that no longer appears). The trigger lives in the interaction between clearComposerDraftContent and the deferred submitNavigationAction effect inside NewTaskDraftScreen; the repo's testing rules exclude rendering the screen to assert it, so the proof is the trace above plus tsc --noEmit and lint clean for apps/mobile. Not exercised on a device in this PR; see the top of the stack.

Claude Fable 5 via Claude Code.

Summary by CodeRabbit

  • New Features

    • Added native text paste support for new-task drafts, including conversion to file attachments when needed.
    • Improved handling of image and file attachments added during draft editing.
  • Bug Fixes

    • Improved handling of shared content when creating new tasks.
    • Prevented consumed shared content from appearing unavailable after sending or clearing a draft.
    • Added safeguards for attachment limits, stale drafts, errors, and duplicate submissions.

@juliusmarminge
juliusmarminge added this pull request to stack #11489 September 13, 2026 00:34
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Sep 13, 2026
@github-actions

github-actions Bot commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ℹ️ No successful main baseline artifact is available yet. This run establishes the initial measurement.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 13.6 KiB 15.1 KiB
Codex Thread snapshot wire 7.1 KiB 7.3 KiB
Codex Live turn WebSocket wire 6.6 KiB 7.8 KiB
Codex Live turn WebSocket decoded 57.1 KiB 66.4 KiB
Codex Live turn messages 10 21
Claude Total thread wire 13.6 KiB 15.1 KiB
Claude Thread snapshot wire 7.1 KiB 7.3 KiB
Claude Live turn WebSocket wire 6.5 KiB 7.8 KiB
Claude Live turn WebSocket decoded 57.8 KiB 66.4 KiB
Claude Live turn messages 9 21

Baseline: unavailable · PR result: 3444b8a · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 113.9 KiB
  • Claude decoded thread snapshot: 114.6 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@juliusmarminge
juliusmarminge marked this pull request as ready for review September 13, 2026 00:52
@macroscopeapp

macroscopeapp Bot commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 99e8209

Macroscope's review found this PR approvable — This is a narrowly scoped mobile bug fix that suppresses a false “shared content unavailable” alert during deferred send navigation. It preserves the existing import and send flow without schema, infrastructure, security, billing, default, or static-analysis changes.

No code changes detected at 3444b8a. Prior analysis still applies.

You can add or adjust custom eligibility rules. Learn more.

Since #10435, sending a new task clears the composer draft synchronously
but defers the navigation by a frame. The share import effect re-ran in
that frame: the draft's importedShareIds receipt was gone, the inbox entry
had already been consumed, so the share looked unavailable and the screen
raised "Shared content unavailable" over a task that had just sent fine.

Remember the share this screen consumed and treat it as imported for the
rest of the screen's life, independent of the draft's receipt.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@juliusmarminge
juliusmarminge force-pushed the share-fix/send-unavailable-alert branch from 99e8209 to 3444b8a Compare September 13, 2026 00:58
@coderabbitai

coderabbitai Bot commented Sep 13, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: c78032a3-3759-43cf-9285-af9c196931fb

📥 Commits

Reviewing files that changed from the base of the PR and between 99e8209 and 3444b8a.

📒 Files selected for processing (1)
  • apps/mobile/src/features/threads/NewTaskDraftScreen.tsx

Included review availability: 3 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 10 reviews per hour.


📝 Walkthrough

Walkthrough

New-task drafts now handle native text paste. The screen inserts text directly within limits or creates a uniquely named file attachment when supported. It also preserves asynchronous insertion state, blocks submission during attachment creation, cleans stale files, and preserves incoming-share state.

Changes

Native paste and draft attachment handling

Layer / File(s) Summary
Define paste and draft state
apps/mobile/src/features/threads/NewTaskDraftScreen.tsx
The screen adds paste utilities, input and attachment limits, asynchronous attachment state, cleanup helpers, and incoming-share tracking. Attachment-strip rendering uses draft attachments only.
Preserve insertion state for attachments
apps/mobile/src/features/threads/NewTaskDraftScreen.tsx
Media, file, and image pickers capture the draft insertion state and calculate capacity against the post-selection draft.
Route native text paste
apps/mobile/src/features/threads/NewTaskDraftScreen.tsx
Native text paste inserts within limits or creates a uniquely named attachment. The screen handles errors, pending work, stale files, submission blocking, event wiring, and accessibility state.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Suggested reviewers: t3dotgg

Sequence Diagram(s)

sequenceDiagram
  participant ComposerEditor
  participant NewTaskDraftScreen
  participant AttachmentStorage
  ComposerEditor->>NewTaskDraftScreen: native text paste event
  NewTaskDraftScreen->>NewTaskDraftScreen: validate text and draft limits
  NewTaskDraftScreen->>AttachmentStorage: create pasted-text attachment
  AttachmentStorage-->>NewTaskDraftScreen: attachment result or error
  NewTaskDraftScreen->>ComposerEditor: insert text or attachment at captured selection
Loading

Merge Risk: ⚪ Minimal · up to 3444b

The updated draft, paste, and share handling has no identified merge-blocking risk.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly describes the primary fix: preventing an incorrect shared-content alert after sending a task.
Description check ✅ Passed The description explains the bug, cause, fix, scope, and verification results. It also states that there are no visual changes and that device testing was not performed. The template checklist is not …
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch share-fix/send-unavailable-alert

Comment @coderabbitai help to get the list of available commands.

@juliusmarminge
juliusmarminge merged commit af0657e into main Sep 13, 2026
32 of 44 checks passed
@juliusmarminge
juliusmarminge deleted the share-fix/send-unavailable-alert branch September 13, 2026 01:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant