Carry who saves and whether the card is new with each card save #258
No reviewers
Labels
No labels
No milestone
No project
No assignees
5 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Grandiras/Ponente!258
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix-card-save-state"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A card's saves queue (save on leave, #242), so a save can run after its dialog has closed or another dialog has opened. Both pages read who is writing, and whether the card is new, from their own state at that moment:
SaveCardused_modalViewer, whichCloseModalresets toBoardViewer.None. A save still queued when the dialog closed was refused, and the edit was lost. This is a likely cause of the occasional "a dated card… cleared" failure incalendar.spec.js.SaveCardused_modalIsNew. With a new card's dialog open by the time an older save ran, it would have created a copy of the card instead of updating it. It also used_viewer, which a board switch changes, since the router reuses the page.CardModalSaveArgsnow carriesIsNewandVieweras they were when the edit was made, and both pages use those.Verified:
tools/verify.sh(600 unit tests); full e2e on an isolated stack, 162/162.🤖 Generated with Claude Code
🤖 Reviewing this PR — the review will link the full session transcript.
📜 Live transcript — updating every ~5 minutes while the review runs.
🤖 Reviewing this PR — follow along in the action run; the reply will link the full session transcript.
📜 Live transcript — updating every ~5 minutes while the task runs.
✅ Verdict: approve — no blocking issues found.
The change is correct and small.
CardModalSaveArgsnow carriesIsNewandViewer, and both pages read them in place of the page-level_modalIsNew,_viewerand_modalViewer.CardModal.razor, and both are updated.CardModal.Viewerexists (line 270).isNewvalue: the autosave path passesfalseand the create path passestrue. That matches what_modalIsNewmeant before.docs/ui.mdis updated with the reason.Two remarks:
Changelog.Unreleasedline is added. If you judge it a bug fix not worth a note, that is fine.🧠 claude-sonnet-5-5 · ⏱ 0m 7s · 3 turns · tokens: 12.7k in / 600 out (+36.6k cache-read)
📜 Full session transcript
✅ Verdict: approve — no blocking issues found.
Good to merge. The fix is correct and complete:
CardModalSaveArgsnow carriesIsNewandVieweras captured at the moment the edit was committed, and sinceSaveAfterchains each queued save with the args captured at its commit, a save running afterCloseModalreset_modalViewer(Calendar) or after a board switch changed_viewer/_modalIsNew(BoardPage) no longer reads stale page state. Both pages now consumeargs.Viewer/args.IsNewconsistently; the record's only instantiation sites are the two inCardModal.razor, so nothing else breaks. Minor note (not a blocker):BoardPage.MoveCardToBoardstill reads_viewerat handler time rather than carrying it inCardModalMoveArgs— that path is interactive (the dialog is open when the user clicks move), so it isn't affected by the queued-save race, but it could be worth aligning if that ever changes.⏱ 1m 36s · 10 steps · $0.0111 · tokens: 46.8k in / 1.2k out (+70.5k cache-read) · Go: 5h 9% · wk 16% · mo 90%
📜 Full session transcript