Commit e0df07e
feat: add persisted sync metadata support (#1380)
* feat(examples): add wa-sqlite OPFS persistence demo to offline-transactions
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(examples): add Vite alias for db-sqlite-persisted-collection-core
The browser wa-sqlite package source re-exports from the core package,
so resolving from source requires both aliases for the build to succeed.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fix some type errors
* ci: apply automated fixes
* feat: add persisted sync metadata RFC
Document the transactional metadata model for persisted collections, including row and collection metadata, query retention, and Electric resume state.
Made-with: Cursor
* feat: add persisted sync metadata implementation plan
Break the persisted sync metadata RFC into phased implementation docs covering the core API, SQLite integration, query collection, Electric collection, and required invariants tests.
Made-with: Cursor
* docs: refine persisted sync metadata design docs
Tighten the RFC and phased plan around startup metadata reads, query-owned reconciliation, cold-row retention cleanup, replay fallback behavior, and Electric reset semantics.
Made-with: Cursor
* feat: implement persisted sync metadata support
Add transactional row and collection metadata plumbing across core sync state, SQLite persistence, query collections, and Electric resume state so persisted ownership and resume metadata survive restarts.
Made-with: Cursor
* ci: apply automated fixes
* fix: align persisted metadata writes with sync startup
Buffer persisted metadata writes within wrapper transactions and dedupe concurrent collection setup so warm starts no longer trip missing sync transaction errors or collection registry races.
Made-with: Cursor
* chore: remove persisted sync metadata docs from branch
Drop the RFC and phased implementation plan from the branch while leaving the local working copies in place.
Made-with: Cursor
* fix: tighten persisted sync metadata restart behavior
Finish the core persisted metadata follow-through so reloads, retained query ownership, and Electric resume/reset state behave correctly across startup and recovery while clarifying metadata semantics around inserts and cleanup.
Made-with: Cursor
* feat: complete persisted sync metadata coverage
Finish the remaining persisted metadata work by adding cold-row retained query cleanup, runtime TTL expiry, stronger Electric resume identity checks, and metadata delta replay for follower recovery while keeping reload fallback for reset-like cases.
Made-with: Cursor
* ci: apply automated fixes
* fix: encode replay deltas with persisted serializer
Use the persisted JSON encoder for replay payloads so bigint and date values survive applied_tx serialization and package-level SQLite adapter tests pass under the CLI runtime.
Made-with: Cursor
* ci: apply automated fixes
* fix: harden persisted startup and resume metadata handling
Restore markReady fallback behavior on persisted startup errors, make load cancellation deterministic, and tighten migration/error handling and resume identity stability so persisted sync state survives edge cases without hanging or false reset fallback.
Made-with: Cursor
* chore: add changeset for persisted metadata follow-ups
Add patch release notes for db, sqlite persisted core, and electric collection to cover startup readiness fallback, deterministic resume identity handling, and migration/truncate metadata hardening.
Made-with: Cursor
* ci: apply automated fixes
* fix(electron-persistence): bridge metadata RPC methods across IPC
Forward collection metadata and row scan adapter calls through the Electron protocol so sqlite adapter contract behavior matches direct-core persistence semantics.
Made-with: Cursor
* ci: apply automated fixes
* chore(expo-e2e): add metro-runtime lockfile entry
Record the Expo runtime dependency update in the workspace lockfile so Expo emulator e2e installs are reproducible in CI.
Made-with: Cursor
* fix(lockfile): drop stale metro-runtime specifier from expo e2e app
Regenerate pnpm-lock.yaml to match the current expo runtime app package spec so frozen-lockfile installs succeed in CI.
Made-with: Cursor
---------
Co-authored-by: Kevin De Porre <kevin@electric-sql.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>1 parent ee81d15 commit e0df07e
17 files changed
Lines changed: 4380 additions & 161 deletions
File tree
- .changeset
- packages
- db-electron-sqlite-persisted-collection
- src
- tests
- db-sqlite-persisted-collection-core
- src
- tests
- db
- src
- collection
- tests
- electric-db-collection
- src
- tests
- query-db-collection
- src
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
Lines changed: 48 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
23 | 36 | | |
24 | 37 | | |
25 | 38 | | |
| |||
110 | 123 | | |
111 | 124 | | |
112 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
113 | 161 | | |
114 | 162 | | |
115 | 163 | | |
| |||
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
| |||
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
33 | 41 | | |
34 | 42 | | |
35 | 43 | | |
| |||
48 | 56 | | |
49 | 57 | | |
50 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
51 | 65 | | |
52 | 66 | | |
53 | 67 | | |
| |||
Lines changed: 29 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
156 | 163 | | |
157 | 164 | | |
158 | 165 | | |
| |||
202 | 209 | | |
203 | 210 | | |
204 | 211 | | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
205 | 234 | | |
206 | 235 | | |
207 | 236 | | |
| |||
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
39 | 55 | | |
40 | 56 | | |
41 | 57 | | |
| |||
0 commit comments