Skip to content
Source
Sign inSign up
TanStack/db

feat: add persisted sync metadata support #1380

Mergedsamwillis(GitHub profile, opens in a new tab)merged 26 commits intomain fromrefs/pull/1380/headmerged by samwillis(GitHub profile, opens in a new tab)

Showing 17 changed files with 75 additions and 0 deletions (loading 14).

x
0 of 17 viewed, 17 left
13 additions and 0 deletions.changeset/persisted-metadata-followups.mdAdded
View file
@@ -0,0 +1,13 @@
+---
+'@tanstack/db': patch
+'@tanstack/db-sqlite-persisted-collection-core': patch
+'@tanstack/electric-db-collection': patch
+---
+​
+fix(persistence): harden persisted startup, truncate metadata semantics, and resume identity matching
+​
+- Restore persisted wrapper `markReady` fallback behavior so startup failures do not leave collections stuck in loading state
+- Replace load cancellation reference identity tracking with deterministic load keys for `loadSubset` / `unloadSubset`
+- Document intentional truncate behavior where collection-scoped metadata writes are preserved across truncate transactions
+- Tighten SQLite `applied_tx` migration handling to only ignore duplicate-column add errors
+- Stabilize Electric shape identity serialization so persisted resume compatibility does not depend on object key insertion order
48 additions and 0 deletionspackages/db-electron-sqlite-persisted-collection/src/main.tsModified
View file
@@ -20,6 +20,19 @@
ElectronPersistedRow,
ElectronPersistedKey
> & {
+ loadCollectionMetadata?: (
+ collectionId: string,
+ ) => Promise<Array<{ key: string; value: unknown }>>
+ scanRows?: (
+ collectionId: string,