Recover foreground dashboard actions from stalled requests #397

Closed
opened 2026-08-09 11:30:12 +00:00 by rockachopa · 0 comments
Member

Problem

Every foreground dashboard API call passes through frontend/session.js, but its shared sessionFetch awaits browser fetches without a deadline. A stalled network can leave detail loaders and mutation single-flight controls pending until the operator reloads the PWA. Existing deadlines cover live polling (#303), background delivery (#305), and navigation (#353), not ordinary foreground API actions.

Vertical slice

Bound all same-origin dashboard /api/v1/ requests at the session boundary, including fresh-authorization and step-up retries. Compose the deadline with caller cancellation, settle even when fetch ignores abort, suppress late responses, preserve cross-origin behavior, and expose stable timeout guidance that distinguishes reads from mutations with potentially ambiguous outcomes. Update the offline shell revision and operator documentation.

Acceptance tests

  • A never/late-settling same-origin API GET rejects with TimeoutError at the configured deadline and aborts its request signal.
  • A fetch implementation that ignores abort cannot deliver a late response to the caller.
  • A caller-provided abort signal still cancels immediately and is not replaced.
  • Same-origin mutation timeout guidance tells the operator to refresh and verify before retrying.
  • Cross-origin requests remain outside the dashboard API deadline.
  • CSRF, 401 handling, fresh authorization, step-up retries, service-worker shell coverage, focused tests, and the full suite remain green.

Non-duplication evidence

Reviewed all 201 historical issue titles through #395, current open issues, releases, and recent origin/main commits. Closest issues are #303 (live polling only), #305 (background delivery only), #353 (navigation only), #127 (one backend review route), and #185 (idempotency without a browser settlement deadline). None bounds the shared foreground session fetch boundary.

## Problem Every foreground dashboard API call passes through `frontend/session.js`, but its shared `sessionFetch` awaits browser fetches without a deadline. A stalled network can leave detail loaders and mutation single-flight controls pending until the operator reloads the PWA. Existing deadlines cover live polling (#303), background delivery (#305), and navigation (#353), not ordinary foreground API actions. ## Vertical slice Bound all same-origin dashboard `/api/v1/` requests at the session boundary, including fresh-authorization and step-up retries. Compose the deadline with caller cancellation, settle even when fetch ignores abort, suppress late responses, preserve cross-origin behavior, and expose stable timeout guidance that distinguishes reads from mutations with potentially ambiguous outcomes. Update the offline shell revision and operator documentation. ## Acceptance tests - A never/late-settling same-origin API GET rejects with `TimeoutError` at the configured deadline and aborts its request signal. - A fetch implementation that ignores abort cannot deliver a late response to the caller. - A caller-provided abort signal still cancels immediately and is not replaced. - Same-origin mutation timeout guidance tells the operator to refresh and verify before retrying. - Cross-origin requests remain outside the dashboard API deadline. - CSRF, 401 handling, fresh authorization, step-up retries, service-worker shell coverage, focused tests, and the full suite remain green. ## Non-duplication evidence Reviewed all 201 historical issue titles through #395, current open issues, releases, and recent `origin/main` commits. Closest issues are #303 (live polling only), #305 (background delivery only), #353 (navigation only), #127 (one backend review route), and #185 (idempotency without a browser settlement deadline). None bounds the shared foreground session fetch boundary.
timmy was assigned by rockachopa 2026-08-09 11:30:12 +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#397
No description provided.