Deliver queued issue captures after the app closes #250

Closed
opened 2026-08-08 01:28:53 +00:00 by timmy · 0 comments
Owner

Problem

Offline issue captures are stored only in page-local localStorage and are flushed by foreground page events. If the installed mobile dashboard is closed before connectivity returns, queued work remains unsent until the user reopens it.

Vertical slice

Persist queued issue captures in a service-worker-visible IndexedDB mirror, register Background Sync after queue changes, and let the worker deliver matching-account captures with the existing stable idempotency key. Keep foreground reconnect as the fallback where Background Sync is unavailable.

Acceptance criteria

  • Queueing an offline issue mirrors it to IndexedDB and requests a background sync without delaying the current UI.
  • A service-worker sync delivers the queued capture after all clients are closed, preserving repository, issue fields, owner, and Idempotency-Key.
  • The worker verifies the current Gitea identity before mutation; unknown/mismatched owners remain queued.
  • Success removes the mirrored item; transient failures remain queued; permanent 4xx failures become attention items.
  • Foreground and worker delivery use an atomic IndexedDB claim so only one request owns an item.
  • Browsers without IndexedDB or Background Sync retain the existing foreground behavior.
  • Worker/API requests are never cached and the app remains subpath-safe.
  • Focused behavioral tests and the full suite pass.
## Problem Offline issue captures are stored only in page-local `localStorage` and are flushed by foreground page events. If the installed mobile dashboard is closed before connectivity returns, queued work remains unsent until the user reopens it. ## Vertical slice Persist queued issue captures in a service-worker-visible IndexedDB mirror, register Background Sync after queue changes, and let the worker deliver matching-account captures with the existing stable idempotency key. Keep foreground reconnect as the fallback where Background Sync is unavailable. ## Acceptance criteria - Queueing an offline issue mirrors it to IndexedDB and requests a background sync without delaying the current UI. - A service-worker sync delivers the queued capture after all clients are closed, preserving repository, issue fields, owner, and `Idempotency-Key`. - The worker verifies the current Gitea identity before mutation; unknown/mismatched owners remain queued. - Success removes the mirrored item; transient failures remain queued; permanent 4xx failures become attention items. - Foreground and worker delivery use an atomic IndexedDB claim so only one request owns an item. - Browsers without IndexedDB or Background Sync retain the existing foreground behavior. - Worker/API requests are never cached and the app remains subpath-safe. - Focused behavioral tests and the full suite pass.
timmy self-assigned this 2026-08-08 01:28:53 +00:00
timmy closed this issue 2026-08-08 01:45:30 +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#250
No description provided.