Make PWA updates resilient with progressive feature caching #619

Closed
opened 2026-08-12 04:19:38 +00:00 by timmy · 0 comments
Owner

Problem

The generated service worker injects all seven interaction-gated feature bundles into the atomic SHELL cache, and installation uses one cache.addAll(SHELL). A transient failure fetching any optional workflow therefore rejects the entire PWA update, preventing unrelated shell/offline/security fixes from activating. This also downloads roughly 92 KB raw / 26 KB gzip of optional workflows at every install despite runtime lazy loading.

Slice

Separate the critical install shell from content-addressed optional feature assets. Keep the critical shell atomic, then warm optional bundles with per-asset failure isolation during activation. Serve successfully warmed feature assets cache-first; a missing optional asset remains network-retryable without compromising the dashboard. Preserve cache generation and private-cache purge semantics.

Acceptance tests

  • A failed optional feature fetch does not reject install/activation or block clients.claim().
  • A failed critical shell fetch still rejects installation atomically.
  • Optional warming caches every successful feature even when a sibling fails.
  • A warmed content-addressed feature is served offline from cache.
  • A never-cached feature can still be fetched normally when online.
  • Feature-only changes rotate shell identity and cannot serve the previous feature revision.
  • Existing session/private-data cache purge behavior remains green.

Evidence / duplicate check

Current origin/main (90f1c48) has src/frontend_bundle.py injecting every FEATURE_SOURCES bundle into SHELL and frontend/service-worker.js installing with one cache.addAll(SHELL). Historical issue/commit review found related completed work (#379 bundling, #511 atomic content-addressed shell, #537/#541/#605 lazy features), but no issue separates critical installation from failure-isolated progressive feature caching.

## Problem The generated service worker injects all seven interaction-gated feature bundles into the atomic `SHELL` cache, and installation uses one `cache.addAll(SHELL)`. A transient failure fetching any optional workflow therefore rejects the entire PWA update, preventing unrelated shell/offline/security fixes from activating. This also downloads roughly 92 KB raw / 26 KB gzip of optional workflows at every install despite runtime lazy loading. ## Slice Separate the critical install shell from content-addressed optional feature assets. Keep the critical shell atomic, then warm optional bundles with per-asset failure isolation during activation. Serve successfully warmed feature assets cache-first; a missing optional asset remains network-retryable without compromising the dashboard. Preserve cache generation and private-cache purge semantics. ## Acceptance tests - A failed optional feature fetch does not reject install/activation or block `clients.claim()`. - A failed critical shell fetch still rejects installation atomically. - Optional warming caches every successful feature even when a sibling fails. - A warmed content-addressed feature is served offline from cache. - A never-cached feature can still be fetched normally when online. - Feature-only changes rotate shell identity and cannot serve the previous feature revision. - Existing session/private-data cache purge behavior remains green. ## Evidence / duplicate check Current `origin/main` (`90f1c48`) has `src/frontend_bundle.py` injecting every `FEATURE_SOURCES` bundle into `SHELL` and `frontend/service-worker.js` installing with one `cache.addAll(SHELL)`. Historical issue/commit review found related completed work (#379 bundling, #511 atomic content-addressed shell, #537/#541/#605 lazy features), but no issue separates critical installation from failure-isolated progressive feature caching.
timmy self-assigned this 2026-08-12 04:19:38 +00:00
timmy closed this issue 2026-08-12 04:26:39 +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#619
No description provided.