fix(onboarding): auto-save every section as a draft, not just completed ones (43)#91
Merged
Merged
Conversation
…ed ones (43) The v0.11.1 fix scoped auto-save to already-completed sections, so first-time onboarding still didn't save answers or sharing on select — the real reported bug. Reproduced with a decrypt-level E2E that fails on v0.11.1 (a first-time section's answer stays null after fill + sharing change with no Continue), then fixed. - submitSectionForm gains markComplete (default true); autoSaveForm sends complete:false so a DRAFT persists answers + answerSharing without completing the section (only nudges notStarted -> inProgress). The explicit Continue/Done still completes. - The auto-save effect fires for every (unlocked) section, not just complete ones, with a flush-on-unmount (no lost edit on a quick Back) and cancel-on-explicit-submit (no draft racing in after the completing submit). 939 core + 855 desktop unit (inverted the stale first-time RTL; +a core draft test) + the new first-time decrypt E2E (answer + scope persist with no Continue; not completed). Re-amended spec 43. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The v0.11.1 fix didn't actually work — you were right. Onboarding answers and the private/sharing status still didn't save on select while filling out onboarding.
Why v0.11.1 missed it (my failure)
I "verified" with an E2E I wrote to pass — and it tested an already-completed section. The real bug is on first-time onboarding. This time I reproduced against the running app first: a new decrypt-level E2E that drives a first-time section fails on v0.11.1 (the answer stays
nullafter fill + sharing change with no Continue), proving the bug before any fix.Root cause
The auto-save effect was gated
if (!complete || locked) return— it only fired on already-completed sections. But onboarding is spent innotStarted/inProgresssections, so nothing auto-saved while you filled them out.The fix
submitSectionFormgains amarkCompleteparam (defaulttrue);autoSaveFormsendscomplete: false— a draft that persists answers +answerSharingbut only nudgesnotStarted → inProgress, never completing the section (so no premature portrait). The explicit Continue/Done is still the only thing that completes.Verification (reproduce-first, decrypt-level)
complete:false; + a coresubmitSectionFormdraft test).🤖 Generated with Claude Code