mirror of
https://github.com/Novaloop-AG/healthchat-web.git
synced 2026-12-03 12:49:30 +00:00
703bd6177c
* Make the persistent-storage request observable and warn when it is denied The end-to-end encryption crypto store lives in IndexedDB. If the origin's storage is not durable, Chromium can evict it under storage pressure, forcing a logout and recovery-key re-entry. tryPersistStorage() requested navigator.storage.persist() but only logged the boolean result, so a denial was invisible. Make the request observable: it is now async and checks persisted() first (short-circuiting to avoid re-requesting/re-prompting), a failure to query the state no longer blocks the request, and a denial warns via the logger (captured by rageshakes) with a stronger desktop-specific message. It never rejects - the sole caller treats it as fire-and-forget. This makes the risk observable but cannot by itself guarantee durability: no Electron main-process API can force per-origin persistence, so a complete cure needs a follow-up. * Address review: log query errors, drop the requestStorageAccess fallback and the desktop-specific warning - Include the caught error when the persisted-state query fails. - Remove the document.requestStorageAccess branch: it is the Storage Access API (cross-site cookie/storage access), not durability, and all supported browsers (Safari >= 15.2 included) have navigator.storage.persist(). - Drop the desktop-specific suffix from the denial warning. - Reword the fire-and-forget doc to avoid referencing the caller. - Simplify the test harness: no descriptor save/restore, delete the stub in afterEach.