Make Done for Today completion durably atomic #1150

Closed
opened 2026-08-19 21:22:26 +00:00 by rockachopa · 0 comments
Member

Problem

today-completion.js removes work and advances the session even when todaySync.enqueue() returns false. First-task onboarding separately announces completion before its activation operation is durably admitted. A storage quota/restriction can therefore resurrect completed work after reload or on another device while the UI has already shown success.

Vertical slice

Persist Today removal and optional first-task completion as one durable outbox batch before advancing the UI. On admission failure, restore the Today item, retain the active session/coach, suppress success receipts, and provide device-storage retry guidance. Preserve normal and undo behavior.

Acceptance tests

  • Forced batch storage failure returns false, restores the item/session, leaves first-task coaching active, performs no flush, and reports actionable storage guidance.
  • First-task completion admits removal plus activation in one durable batch and only then advances/shows completion.
  • Established-user completion admits only removal and preserves existing undo/session behavior.
  • Reconnect delivers the admitted batch together and clears it only through operation receipts.
  • Focused tests and full suite pass.

Audit evidence: frontend/today-completion.js ignores the enqueue result; frontend/today-sync.js explicitly returns false on persistence failure; frontend/mobile-first-task.js stores/displays completion before its event-driven activation enqueue. No historical issue title or recent commit covers atomic admission failure for this flow.

## Problem `today-completion.js` removes work and advances the session even when `todaySync.enqueue()` returns false. First-task onboarding separately announces completion before its activation operation is durably admitted. A storage quota/restriction can therefore resurrect completed work after reload or on another device while the UI has already shown success. ## Vertical slice Persist Today removal and optional first-task completion as one durable outbox batch before advancing the UI. On admission failure, restore the Today item, retain the active session/coach, suppress success receipts, and provide device-storage retry guidance. Preserve normal and undo behavior. ## Acceptance tests - Forced batch storage failure returns false, restores the item/session, leaves first-task coaching active, performs no flush, and reports actionable storage guidance. - First-task completion admits removal plus activation in one durable batch and only then advances/shows completion. - Established-user completion admits only removal and preserves existing undo/session behavior. - Reconnect delivers the admitted batch together and clears it only through operation receipts. - Focused tests and full suite pass. Audit evidence: `frontend/today-completion.js` ignores the enqueue result; `frontend/today-sync.js` explicitly returns false on persistence failure; `frontend/mobile-first-task.js` stores/displays completion before its event-driven activation enqueue. No historical issue title or recent commit covers atomic admission failure for this flow.
timmy was assigned by rockachopa 2026-08-19 21:22:26 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: stackchain/stackchain-dashboard#1150
No description provided.