Skip to content
Source
Sign inSign up
TanStack/db

fix(persistence): rotate invalid on-demand caches and reload subsets #2069

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

Showing 141 changed files with 71 additions and 10 deletions (loading 138).

x
0 of 141 viewed, 141 left
16 additions and 0 deletions.changeset/electric-scoped-recovery.mdAdded
View file
@@ -0,0 +1,16 @@
+---
+'@tanstack/db': patch
+'@tanstack/db-sqlite-persistence-core': patch
+'@tanstack/electric-db-collection': patch
+'@tanstack/query-db-collection': patch
+'@tanstack/browser-db-sqlite-persistence': patch
+'@tanstack/node-db-sqlite-persistence': patch
+'@tanstack/expo-db-sqlite-persistence': patch
+'@tanstack/react-native-db-sqlite-persistence': patch
+'@tanstack/electron-db-sqlite-persistence': patch
+'@tanstack/capacitor-db-sqlite-persistence': patch
+'@tanstack/tauri-db-sqlite-persistence': patch
+'@tanstack/cloudflare-durable-objects-db-sqlite-persistence': patch
+---
+​
+Recover persisted on-demand Electric and Query collections after cache claim loss by rotating their SQLite cache and reloading active subsets. Fence retired provider work and expired claims, preserve warm runs on their claimed cache generation, and forward claim lifetime options through SQLite host factories. Require explicit eager or claim-bound managed targets for SQLite adapter data operations, and forward them through Electron IPC protocol v6. Bare collection IDs no longer work at this lower-level adapter boundary.
53 additions and 10 deletionsdocs/collections/electric-collection.mdModified
View file
@@ -347,6 +347,14 @@
settle waits in a restarted collection. Observe these promises even when the
component or collection may be disposed before they settle.
​
+An on-demand Collection with managed SQLite persistence can also replace its
+Electric provider session within the same Collection sync run when its cached