Lock cached dashboard after the confirmed idle deadline #523

Closed
opened 2026-08-10 23:50:20 +00:00 by timmy · 0 comments
Owner

Problem

The server enforces the 15-minute inactivity timeout, but the installed PWA persists only the eight-hour absolute expiry. During an outage or cold offline launch, the service worker can therefore expose the cached private dashboard after the server-side idle deadline.

User flow

Publish the server-confirmed idle deadline with session metadata and successful activity heartbeats. Persist both deadlines in the browser and service worker. At the idle deadline, lock without deleting drafts/outboxes; at absolute expiry, retain the existing destructive purge. A failed heartbeat must never extend either deadline.

Acceptance tests

  • Authenticated session status returns a non-cacheable idle_expires_at without extending activity; anonymous status discloses no lease.
  • A successful activity heartbeat republishes the confirmed idle deadline; failed/offline heartbeats do not extend it.
  • Active pages lock exactly once at idle expiry without clearing private browser data.
  • Offline navigation before idle expiry serves the cached shell. At/after idle expiry it returns a non-cacheable idle lock response and preserves drafts/outboxes/caches.
  • Absolute expiry still purges private browser data and caches.

Evidence / non-duplication

src/main.py session status exposes only expires_at; frontend/session.js and frontend/service-worker.js schedule/check only that value. Historical issue #463 added server-side idle validation, and #399 added absolute offline expiry, but neither enforces the shorter idle boundary offline. No open/closed issue title or recent commit implements an offline idle lease.

## Problem The server enforces the 15-minute inactivity timeout, but the installed PWA persists only the eight-hour absolute expiry. During an outage or cold offline launch, the service worker can therefore expose the cached private dashboard after the server-side idle deadline. ## User flow Publish the server-confirmed idle deadline with session metadata and successful activity heartbeats. Persist both deadlines in the browser and service worker. At the idle deadline, lock without deleting drafts/outboxes; at absolute expiry, retain the existing destructive purge. A failed heartbeat must never extend either deadline. ## Acceptance tests - Authenticated session status returns a non-cacheable `idle_expires_at` without extending activity; anonymous status discloses no lease. - A successful activity heartbeat republishes the confirmed idle deadline; failed/offline heartbeats do not extend it. - Active pages lock exactly once at idle expiry without clearing private browser data. - Offline navigation before idle expiry serves the cached shell. At/after idle expiry it returns a non-cacheable idle lock response and preserves drafts/outboxes/caches. - Absolute expiry still purges private browser data and caches. ## Evidence / non-duplication `src/main.py` session status exposes only `expires_at`; `frontend/session.js` and `frontend/service-worker.js` schedule/check only that value. Historical issue #463 added server-side idle validation, and #399 added absolute offline expiry, but neither enforces the shorter idle boundary offline. No open/closed issue title or recent commit implements an offline idle lease.
timmy self-assigned this 2026-08-10 23:50:20 +00:00
timmy closed this issue 2026-08-11 00:02:40 +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#523
No description provided.