Recover queued delivery when background requests stall #305

Closed
opened 2026-08-08 13:38:26 +00:00 by timmy · 0 comments
Owner

Problem

The closed-app outbox awaits background identity, CSRF, and mutation requests without a deadline. A never-settling request keeps the durable claim and shared flush promise alive indefinitely, so later sync/resume attempts cannot deliver queued work and device purge can block behind the stalled drain.

Evidence on origin/main (6138b1f): frontend/background-issue-sync.js awaits identity and delivery directly and retains activeFlush until settlement; frontend/service-worker.js performs unbounded CSRF and mutation fetches. Existing #297 bounds concurrency but assumes requests settle; #303 covers live polling only. No historical issue title or recent commit covers stalled background outbox requests.

Acceptance criteria

  • A never-settling identity or mutation request is aborted after a configurable deadline.
  • Timed-out mutation claims return to queued and a later flush retries with the same idempotency key.
  • Device purge cancels an active drain and closes the durable store promptly.
  • Late completions cannot confirm work after cancellation.
  • Focused behavioral tests and the full suite pass.
## Problem The closed-app outbox awaits background identity, CSRF, and mutation requests without a deadline. A never-settling request keeps the durable claim and shared flush promise alive indefinitely, so later sync/resume attempts cannot deliver queued work and device purge can block behind the stalled drain. Evidence on `origin/main` (`6138b1f`): `frontend/background-issue-sync.js` awaits identity and delivery directly and retains `activeFlush` until settlement; `frontend/service-worker.js` performs unbounded CSRF and mutation fetches. Existing #297 bounds concurrency but assumes requests settle; #303 covers live polling only. No historical issue title or recent commit covers stalled background outbox requests. ## Acceptance criteria - A never-settling identity or mutation request is aborted after a configurable deadline. - Timed-out mutation claims return to queued and a later flush retries with the same idempotency key. - Device purge cancels an active drain and closes the durable store promptly. - Late completions cannot confirm work after cancellation. - Focused behavioral tests and the full suite pass.
timmy self-assigned this 2026-08-08 13:38:26 +00:00
timmy closed this issue 2026-08-08 13:48:07 +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#305
No description provided.