Coordinate offline outboxes safely across dashboard tabs #242

Closed
opened 2026-08-07 23:28:19 +00:00 by rockachopa · 0 comments
Member

User problem

The installed dashboard and a browser tab can flush the same offline issue/message queues concurrently. Each outbox only has a tab-local pending map, Drafts does not update when another tab changes a queue, and stale tabs can duplicate requests or hide current queue state.

Vertical slice

Add a shared browser-tab coordinator for both offline outboxes: one expiring flush lease per queue, cross-tab queue-change notifications, live Drafts refresh, and takeover after a crashed lease owner. Preserve stable idempotency keys, account quarantine, queue caps, and existing retry/edit behavior.

Acceptance

  • Two tabs reconnecting together produce one request per queued operation.
  • A stalled/crashed owner lease expires and another tab resumes the queue.
  • Enqueue/update/discard/send changes refresh Drafts in other tabs without polling.
  • Foreground single-tab and unsupported-browser behavior remain functional.
  • Focused behavioral tests and the full suite pass.

Evidence / non-duplication

Current issue-outbox.js and authored-outbox.js protect sends only with process-local pending maps; index.html flushes independently in every page; drafts.js has no cross-tab subscription. All 238 historical issue/PR records and recent commits through 8b71de7 were checked: completed offline queue work #232-#239 covers persistence and account binding, but no title or implementation covers multi-tab coordination, shared leases, or live cross-tab Drafts refresh.

## User problem The installed dashboard and a browser tab can flush the same offline issue/message queues concurrently. Each outbox only has a tab-local `pending` map, Drafts does not update when another tab changes a queue, and stale tabs can duplicate requests or hide current queue state. ## Vertical slice Add a shared browser-tab coordinator for both offline outboxes: one expiring flush lease per queue, cross-tab queue-change notifications, live Drafts refresh, and takeover after a crashed lease owner. Preserve stable idempotency keys, account quarantine, queue caps, and existing retry/edit behavior. ## Acceptance - Two tabs reconnecting together produce one request per queued operation. - A stalled/crashed owner lease expires and another tab resumes the queue. - Enqueue/update/discard/send changes refresh Drafts in other tabs without polling. - Foreground single-tab and unsupported-browser behavior remain functional. - Focused behavioral tests and the full suite pass. ## Evidence / non-duplication Current `issue-outbox.js` and `authored-outbox.js` protect sends only with process-local `pending` maps; `index.html` flushes independently in every page; `drafts.js` has no cross-tab subscription. All 238 historical issue/PR records and recent commits through `8b71de7` were checked: completed offline queue work #232-#239 covers persistence and account binding, but no title or implementation covers multi-tab coordination, shared leases, or live cross-tab Drafts refresh.
timmy was assigned by rockachopa 2026-08-07 23:28:19 +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#242
No description provided.