Prefs work offline #100

Closed
opened 2026-10-14 03:04:51 +00:00 by kayg · 2 comments
Owner

Settings saved on the server (#73) need the network today. Cache prefs locally (IndexedDB), apply them at first paint with no flash, queue changes made offline with idempotency keys, and replay on reconnect. Last writer wins per key; a conflicting newer server value wins and the UI updates in place. Tests: Playwright offline toggle in Chromium and WebKit, plus no layout shift at first paint.

Settings saved on the server (#73) need the network today. Cache prefs locally (IndexedDB), apply them at first paint with no flash, queue changes made offline with idempotency keys, and replay on reconnect. Last writer wins per key; a conflicting newer server value wins and the UI updates in place. Tests: Playwright offline toggle in Chromium and WebKit, plus no layout shift at first paint.
Author
Owner

Evidence (PR #110):

  • bun run check: 0 errors.
  • New e2e prefs-offline.spec.ts: 6/6 pass in chromium-1440 and webkit-1440 (offline edit, offline reload with no flash and no layout shift in Chromium, replay on reconnect, same idempotency key on retry, newer server value wins in place).
  • Existing prefs, pwa, shortcuts, served and flow specs pass. Other failures in one full loaded run (editor CPU x6 layout, links:101, day:40 on WebKit) pass when run alone, so they were load timeouts.
  • Perf: reading the local copy from IndexedDB takes a median 1.2 ms in Chromium (4.0 ms in WebKit under load) on a reload. It replaces waiting for prefs.get before first paint when a copy exists.
  • Finding: the bottom bar (.morph) widens 114 to 278 px just after mount (layout shift about 0.001), with or without prefs. Not touched here; may deserve its own issue.
Evidence (PR #110): - `bun run check`: 0 errors. - New e2e `prefs-offline.spec.ts`: 6/6 pass in chromium-1440 and webkit-1440 (offline edit, offline reload with no flash and no layout shift in Chromium, replay on reconnect, same idempotency key on retry, newer server value wins in place). - Existing prefs, pwa, shortcuts, served and flow specs pass. Other failures in one full loaded run (editor CPU x6 layout, links:101, day:40 on WebKit) pass when run alone, so they were load timeouts. - Perf: reading the local copy from IndexedDB takes a median 1.2 ms in Chromium (4.0 ms in WebKit under load) on a reload. It replaces waiting for `prefs.get` before first paint when a copy exists. - Finding: the bottom bar (`.morph`) widens 114 to 278 px just after mount (layout shift about 0.001), with or without prefs. Not touched here; may deserve its own issue.
Author
Owner

CI on PR #110: rust passes. web fails with 13 timeouts in editor, links, info, day and trash specs (mostly WebKit, plus the CPU x6 layout test), the same set other PRs and my own loaded local run show; they pass when run alone. All 6 new prefs-offline tests pass in CI (Chromium and WebKit), and prefs, pwa, served and flow specs pass. A re-run on a less busy runner is needed to get green.

CI on PR #110: rust passes. web fails with 13 timeouts in editor, links, info, day and trash specs (mostly WebKit, plus the CPU x6 layout test), the same set other PRs and my own loaded local run show; they pass when run alone. All 6 new `prefs-offline` tests pass in CI (Chromium and WebKit), and prefs, pwa, served and flow specs pass. A re-run on a less busy runner is needed to get green.
kayg closed this issue 2026-10-14 04:10:57 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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
kayg/calternal#100
No description provided.