Keep Today and Later edits lossless across browser tabs #373

Closed
opened 2026-08-09 05:23:37 +00:00 by timmy · 0 comments
Owner

User impact

Today and Later queues use whole-array localStorage read/modify/write. A delivery receipt in one tab can overwrite an edit queued by another tab, silently losing an operator’s plan before it reaches the server.

Scope

Store pending planning operations as independently keyed records, coordinate Today/Later drains across tabs with the existing outbox coordinator, migrate legacy array queues, and notify peer tabs when work is queued.

Acceptance tests

  • Concurrent Today enqueues in two tabs both remain durable and are delivered exactly once.
  • Removing a delivered operation cannot erase another tab’s newly queued operation.
  • The same guarantees hold for Later, with the newest same-item intent applied deterministically.
  • Only one active PATCH drain runs per account and skipped peers resume after a queue signal.
  • Existing array queues migrate without data loss; account boundaries and all existing sync behaviors remain intact.
  • Focused tests and the complete suite pass; the updated service-worker shell contains the changed assets.

Evidence / non-duplication

frontend/today-sync.js and frontend/later-sync.js currently rewrite one shared JSON array. frontend/outbox-coordinator.js supports only issue/authored signals. Historical #242 coordinated issue/authored outboxes before planning sync existed; #361/#363/#365/#367 cover snapshots, cross-device sync, retries, and same-tab draining, not atomic cross-tab planning queues. No open/closed issue title or recent commit implements this behavior.

## User impact Today and Later queues use whole-array localStorage read/modify/write. A delivery receipt in one tab can overwrite an edit queued by another tab, silently losing an operator’s plan before it reaches the server. ## Scope Store pending planning operations as independently keyed records, coordinate Today/Later drains across tabs with the existing outbox coordinator, migrate legacy array queues, and notify peer tabs when work is queued. ## Acceptance tests - Concurrent Today enqueues in two tabs both remain durable and are delivered exactly once. - Removing a delivered operation cannot erase another tab’s newly queued operation. - The same guarantees hold for Later, with the newest same-item intent applied deterministically. - Only one active PATCH drain runs per account and skipped peers resume after a queue signal. - Existing array queues migrate without data loss; account boundaries and all existing sync behaviors remain intact. - Focused tests and the complete suite pass; the updated service-worker shell contains the changed assets. ## Evidence / non-duplication `frontend/today-sync.js` and `frontend/later-sync.js` currently rewrite one shared JSON array. `frontend/outbox-coordinator.js` supports only issue/authored signals. Historical #242 coordinated issue/authored outboxes before planning sync existed; #361/#363/#365/#367 cover snapshots, cross-device sync, retries, and same-tab draining, not atomic cross-tab planning queues. No open/closed issue title or recent commit implements this behavior.
timmy self-assigned this 2026-08-09 05:23:37 +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#373
No description provided.