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).
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 onbeforeunload.Likely trigger
Continuous typing with a crash or OS kill before a >=200 ms pause.
Proposed fixes
Landed on
fix/prompt-draft-persistence(merged, release7345a87552): a bounded 1 s max-wait flush plus an AppState background/inactive flush on mobile; web addspagehideand hiddenvisibilitychange. Tests restore a long draft after a hard kill.Related
#4 (iPad). Branch
fix/prompt-draft-persistence.Severity: Medium (loss of in-progress text).