Skip to content

[Bug]: Mobile new-task draft is saved under Unsent but not resumed when navigating away #15974

Open

Description

@simonsteiner

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/mobile

Steps to reproduce

  1. On Android, tap + to start a new task (NewTaskSheet -> NewTask composer).
  2. Type prompt text but do not send.
  3. Press Android back / navigate away (dismisses the sheet via closeNewTask -> parentNavigation.goBack()).
  4. Tap + again to start a new task.
  5. Check the thread list Unsent section.

Expected behavior

Returning resumes the same draft in the composer (like web, which reuses/resumes the per-project draft via stable DraftId). At minimum, navigating away should flush the pending draft write so nothing is lost.

Actual behavior

Update 2026-10-05: field screenshot confirms the typed text IS saved — it appears under the thread list Unsent section as a Draft row (e.g. "sync with upstream. on mobile"). So the original "not saved as draft" report was imprecise.

The remaining gap is resume, not persistence: the composer binding (activeDraftKey provider-local useState) is lost on sheet unmount, and re-entry always mints a fresh draft ("A fresh New Task never reuses one"), so the composer opens empty and the user must find and reopen the Unsent draft row manually. Secondary edge: dirty text does not guard back navigation, and there is no flushComposerDrafts() on sheet dismiss, so typing + backing out within the 200ms persist debounce can still lose the disk write.

Code pointers (main @ cf3e714b0f):

  • apps/mobile/src/features/threads/new-task-flow-provider.tsx:291 (activeDraftKey provider-local state, lost on unmount), :466-476 (fresh draft mint), :589 (never reuses), :651-658 (setPrompt -> setComposerDraftText), :753-763 (in-flow retarget is fine)
  • apps/mobile/src/features/threads/NewTaskDraftScreen.tsx:1412-1459 (composer), :514-518 (usePreventRemove only while submitting/transferring, not dirty text), :1463-1471 (close/goBack)
  • apps/mobile/src/state/use-composer-drafts.ts:66,1000-1025 (200ms debounced persist), :777-807 (flushComposerDrafts never called on dismiss/unmount)
  • Web contrast: apps/web/src/composerDraftStore.ts:89,97-115,132-137 (localStorage + debounce + beforeunload flush), threadRoutes.ts:83 + hooks/useHandleNewThread.ts:164-195 (stable DraftId resume)

Impact

Minor bug or occasional failure

Version or commit

main @ cf3e714

Environment

Android (mobile app), reported from field testing

Logs or stack traces

None - text is preserved under Unsent but not resumed; no error.

Workaround

Reopen the saved draft via its Unsent Draft row (usePendingTaskListActions.ts:16-30 -> NewTaskDraft -> { draftId }).

Activity

  1. changed the title [-][Bug]: Mobile new-task draft is orphaned when navigating away before sending[/-] [+][Bug]: Mobile new-task draft is saved under Unsent but not resumed when navigating away[/+] on Oct 5, 2026
  2. added
    needs more infoInitial triage showed no bug. Awaiting more info
    and removed
    needs more infoInitial triage showed no bug. Awaiting more info
    on Oct 22, 2026
  3. added a commit that references this issue on Oct 27, 2026
    be8e702
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions