Skip to content
Source
Sign inSign up
TanStack/db

fix: preserve persisted Electric resume baseline integrity #1846

MergedKyleAMathews(GitHub profile, opens in a new tab)merged 30 commits intomain fromrefs/pull/1846/headmerged by KyleAMathews(GitHub profile, opens in a new tab)

Showing 45 changed files with 132 additions and 3 deletions (loading 42).

x
0 of 45 viewed, 45 left
14 additions and 0 deletions.changeset/preserve-resume-baseline-integrity.mdAdded
View file
@@ -0,0 +1,14 @@
+---
+'@tanstack/db-sqlite-persistence-core': minor
+'@tanstack/db': minor
+'@tanstack/browser-db-sqlite-persistence': patch
+'@tanstack/electron-db-sqlite-persistence': minor
+'@tanstack/electric-db-collection': patch
+'@tanstack/query-db-collection': patch
+'@tanstack/node-db-sqlite-persistence': patch
+'@tanstack/react-native-db-sqlite-persistence': patch
+---
+​
+Preserve persisted resume integrity with atomic SQLite baseline evidence and stale-writer rejection, expose persistence sync metadata as one versioned capability, and refresh uncertified Electric baselines before publishing resumed data.
+​
+This changes the public persistence contracts: custom `PersistenceAdapter` implementations must now implement `loadResumeSnapshot`, and `SyncMetadataApi.persistence` is required with `null` explicitly representing no persistence. Custom sync wrappers that receive metadata must forward `metadata.persistence` unchanged so consumers receive either that sentinel or the complete versioned capability. A direct sync invocation may still omit the optional metadata object entirely, which consumers treat as no persistence. The Electron bridge now transports the atomic resume snapshot through IPC protocol v2; Electron main and renderer integrations must upgrade together because mixed v1/v2 peers fail closed. Node and React Native persistence instances that wrap one database handle now share transaction admission so concurrent collection startup cannot overlap transactions on that connection.
83 additions and 3 deletionsdocs/contributing/oracle-coverage.mdModified
View file
@@ -62,7 +62,7 @@
| Opaque backend pagination | Complete | The full-relation value model plus opaque token, cache generation, publication, browser acquisition, and live-window integration owners are literate. |
| Electric and TrailBase | Complete | Electric replica and recovery models, installed-SDK HTTP delivery, PostgreSQL serialization, and TrailBase's controlled RecordApi/native-stream lifecycle are literate with their real-provider limits intact. |
| PowerSync | Complete | Patch conservation, effective-update receipts, metadata and falsey changes, declared-view keys, transformed schema output, logging, cleanup, and native SQLite reach are literate. |
-| SQLite persistence and native hosts | Complete | Persisted hydration/replay and ownership, shared driver transaction laws, OPFS page and diagnostic state machines, and the 113-law native conformance manifest are literate. Native execution remains distinct from registration and shim evidence. |
+| SQLite persistence and native hosts | Complete | Persisted hydration/replay and ownership, shared-handle driver transaction laws, OPFS page and diagnostic state machines, and the 113-law native conformance manifest are literate. Native execution remains distinct from registration and shim evidence. |
| Offline execution | Complete | FIFO retry, scheduler eligibility, leadership replay, transaction settlement, and typed wire serialization are literate. |
| Frameworks | Complete | Shared live-query and infinite-query models are literate. Each framework keeps its own realm, ownership, and scheduling driver. |