Skip to content

bug(composer): a partially composed prompt is lost when the app hard-crashes #8

Description

@nohat

Problem

On iPad (2026-10-03) the app hard-crashed in the middle of a long prompt; after relaunch the draft was gone.

What the code shows

Mobile drafts (apps/mobile/src/state/use-composer-drafts.ts) armed a single 200 ms debounce that reset on every keystroke, so continuous typing produced no write at all; there was no AppState flush. Web flushed only on beforeunload.

Likely trigger

Continuous typing with a crash or OS kill before a >=200 ms pause.

Proposed fixes

Landed on fix/prompt-draft-persistence (merged, release 7345a87552): a bounded 1 s max-wait flush plus an AppState background/inactive flush on mobile; web adds pagehide and hidden visibilitychange. Tests restore a long draft after a hard kill.

Related

#4 (iPad). Branch fix/prompt-draft-persistence.

Severity: Medium (loss of in-progress text).

Activity

  1. added
    bugSomething isn't working
    on Oct 4, 2026
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

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions