Skip to content

feat(offline): support durable PWA notes and automatic sync - #94

Merged
sianachi merged 4 commits into
mainfrom
feature/offline-notes
Oct 11, 2026
Merged

sianachi merged 4 commits into
mainfrom
feature/offline-notes

Conversation

@sianachi

@sianachi sianachi commented Oct 11, 2026 •

Copy link
Copy Markdown
Owner

Nix now downloads every accessible, unlocked prose note into a device library, so users can read, edit, rename and create notes after a cold offline launch. Reconnecting with the PWA open publishes new notes once and merges pending writing with the server without clearing local drafts.

Notes on this device provides title search and parent selection. IndexedDB retains note metadata, confirmed Yjs bodies, pending updates, publication receipts and supported note assets. Readiness is reported only after the complete visible library has downloaded. Locked notes and canvas, spreadsheet and file bodies are outside this prose library.

Core remains the permission authority. Reconnect refreshes visibility and locks, transfers checkpoints and update tails without opening a socket for every downloaded note, checks document identity and clears journal entries only after exact durable acknowledgement. Scoped creation receipts prevent duplicate items after a lost response and recover interrupted publication even when its local creation cache is missing. Temporary BFF failures retain cached access; definitive refusals fence cached content while preserving pending owner recovery. Credential expiry requests renewal, and both sign-out controls flush writing before offering local removal.

Validation:

All eight pull-request CI checks passed on final head 38e650df9c436dc020bbea52453cc75dead81a0d, including the full backend integration suite.

  • Web: 336 files / 3,635 tests passed in the final full run; lint, TypeScript, formatting, production build, frontend guards and their self-tests passed. Two UI wait timeouts in an earlier concurrent run passed on the isolated 38-test rerun and the final full run with three workers. The account-switch fixture now explicitly supplies functional storage and requires cleanup of the exact departing account generation; all 70 auth cases passed.
  • Collaboration: 421 tests passed, including real socket expiry and fresh permission checks; lint and TypeScript passed.
  • Core: 1,723 unit tests, Release build, format, selected architecture guards and generated OpenAPI/client freshness passed. The initial full integration run passed 1,346 tests; a later fixture-seeding timeout passed on isolated rerun. The optional Versity storage check also passed when enabled.
  • CLI: 472 tests and selected lint/TypeScript checks passed. API-client and UI selected suites passed. Native ADR0062 and archive catalog roundtrip checks passed. Independent UX, DX, performance, security and backend-data reviews approved the source.
  • Real Chromium and WebKit acceptance passed with more than 5,200 notes: unopened nested bodies, cold offline launches, edits and creation surviving reload/restart, sign-out cancellation, automatic reconnect with concurrent server writing, durable server reads and exactly one published child.
  • Final production-build bytes passed normal PWA update, cold offline edit/create and reconnect checks in both engines. An older interrupted profile recovered all three pending drafts through the normal update flow, with durable server proof and no local-data clearing.

WebKit acceptance used an isolated Playwright 1.64 runtime because the repository's Playwright 1.62 offline emulation has the upstream failure fixed in microsoft/playwright#42894. The application dependencies are unchanged. Real iPhone/iPad retention and battery measurements remain unverified. Browser storage can be cleared by the user or operating system; the first download and reconnect sync require the PWA to be open.

@sianachi
sianachi marked this pull request as ready for review October 11, 2026 02:21
@sianachi
sianachi merged commit 5d3e050 into main Oct 11, 2026
8 checks passed
@sianachi
sianachi deleted the feature/offline-notes branch October 15, 2026 17:24
sianachi added a commit that referenced this pull request Oct 21, 2026
* feat(offline): add durable PWA notes and reconnect sync

* fix(offline): enumerate pending note scopes on WebKit

* fix(offline): recover interrupted local note publication

* test(web): bind account renewal fixture to cache epoch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant