PWA gap: Service worker doesn't cache IndexedDB data — offline shows empty app #9
Labels
No labels
blocked:depends-p1
blocked:gate-research
blocked:lint-failed
blocked:needs-decision
blocked:needs-human
blocked:verify-failed
bug
data-loss
documentation
enhancement
feature-request
in-progress
needs-decompose
needs-triage
pwa
quickfix
security
security/high
security/medium
test
test-coverage
triage-approved
vault
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/kimi_agent_kin_app_sync#9
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: MEDIUM (PWA completeness)
Location
public/sw.js— Service WorkerDescription
The service worker precaches static assets and caches JS/CSS/fonts at runtime, but does NOT cache the IndexedDB data that the app actually displays. When offline:
The SW uses a network-first strategy for navigation, meaning every page load tries the network before falling back to cache — a poor offline UX even for the shell:
Impact
Recommendation
Code context
public/sw.js— full service workerGSD RESEARCH could not determine a clear fix.
STATUS: UNCLEAR
EVIDENCE: The sw.js has not been modified since the initial bootstrap (4 commits, all lint/format cleanup only). However, the issue itself is based on a technical misunderstanding that needs clarification before any fix can proceed.
Current sw.js (75 lines) does:
caches.match...cached || fetch)Fix deployed in
0b940d5Analysis: IndexedDB (Dexie) persists data locally regardless of network state — the SW does not need to "cache" DB data. The app already auto-seeds sample data on first launch.
What was missing: user confidence. Added an
OnlineStatusindicator in the sidebar bottom section showing:Not a PWA bug, but a UX gap — users need to know their data is available offline.