mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-13 22:32:04 +00:00
fix(pwa): restore the dashboard snapshot only for its own account
On a cold start the IndexedDB snapshot was restored before /api/auth/me had answered, and the owner check was skipped while the account was unknown. On a shared browser the previous account's dashboard could be put into the next account's cache until the refetch landed. The restore now waits until the signed-in account is known and runs again when it changes. A snapshot whose owner is not that account, or that was written before any account was known, is discarded and wiped. Because the restore now lands after the page has mounted, it fills queries that have no data yet instead of skipping every query the cache already knows; data the page holds is still never overwritten.
This commit is contained in:
1 parent
0df65ce396
commit
433b92a67f
5 files changed
+152
-44
No files matched your search
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$comment": "Comment lines that open with a release version, per file under src/. Maintained by src/__tests__/version-stamp-ratchet.test.ts.",
|
||||
"count": 2888,
|
||||
"total": 9205,
|
||||
"total": 9204,
|
||||
"entries": {
|
||||
"__tests__/account-payload-consumer-guard.test.ts": 2,
|
||||
"__tests__/acting-account-boundary-guard.test.ts": 7,
|
||||
@@ -1277,7 +1277,7 @@
|
||||
"components/onboarding/welcome-screen.tsx": 1,
|
||||
"components/profile/__tests__/height-entry-surfaces.test.tsx": 1,
|
||||
"components/profile/height-field-control.tsx": 1,
|
||||
"components/providers.tsx": 3,
|
||||
"components/providers.tsx": 2,
|
||||
"components/records/about-me-note-manager.tsx": 3,
|
||||
"components/records/ai-profile-inclusion-manager.tsx": 1,
|
||||
"components/records/allergy-form.tsx": 1,
|
||||
|
||||
Reference in new issue
Block a user