feat(sync): sync support for the native app #68
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/sync-support"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Sync support for the native app
Gives offline clients a way to pull everything that changed for a user since a cursor, including deletions and global rows, and to push a batch of local changes with client-minted ids, resolved by last write wins. The REST endpoints and the web app are unchanged.
Spec:
docs/superpowers/specs/2026-10-13-api-sync-support-design.md. Consumer:rollnote-appbranchfeat/foundation.What is in
updatedAt(NOT NULL, millisecond precision) andsyncedAt(server write time, the only pull cursor) on the 11 synced tables, with sync indexes; newsync_tombstoneandsync_resettables; migration0028_sync_supportwith backfills.GET /sync/status,GET /sync/pull/:entity(keyset on(syncedAt, id)),GET /sync/tombstones,POST /sync/push(up to 200 ops, one transaction per op, statusesapplied | stale | renumbered | missing-parent | rejected | retry, shoot row locks for frame writes, clock clamp, nulling of references to tombstoned rows).expo()plugin,rollnote://trusted origin (plusexp://in development), origin checks kept on in tests.Verification
Lint and build clean; 152 unit and 186 integration tests (testcontainers), including a two-client convergence suite, tombstone cascades, overlap and reset cases. The native foundation's device acceptance ran against this branch.
Notes
0028in the main checkout (isGlobal NOT NULL, film_format unique); whichever merges second must be renumbered and its snapshot regenerated.resyncBeforealready covers the 180-day retention edge.https://claude.ai/code/session_013Ew5mX388EkuWC6ytSKkdc