mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 12:32:43 +00:00
The offline layer wrote far too much to disk and cleared it too rarely. The query persister used a denylist (only auth/session/admin/tokens), so every other family — coach, insights, illness, labs, mood, cycle — was dehydrated to IndexedDB in plaintext; the service worker likewise prefix-cached GET /api/insights, which serves decrypted Coach conversations. Neither store carried an account marker and both were wiped only on explicit logout, so a session that ended by expiry or a 401 left health data on disk for the next account on a shared profile. Flip the persister to a strict allowlist (dashboard snapshot, per-chart series, widget layout — the offline-dashboard set only) and stamp each payload with the live account id, discarding on mismatch. Drop /api/insights and /api/analytics from the worker allowlist. Wipe the IndexedDB blob and the data/page caches on every session end — the 401/expiry redirect and the logout path both route through one helper.