Skip to content
Source
Sign inSign up
TanStack/db

fix(db-sqlite-persistence-core): persisted preload() hangs when upstream sync never calls markReady #1615

ClosedPHILLIPS71(GitHub profile, opens in a new tab)wants to merge 6 commits intomain fromrefs/pull/1615/headopened

Showing 3 changed files with 39 additions and 10 deletions (loading 1).

x
0 of 3 viewed, 3 left
5 additions and 0 deletions.changeset/free-rivers-like.mdAdded
View file
@@ -0,0 +1,5 @@
+---
+'@tanstack/db-sqlite-persistence-core': patch
+---
+​
+fix: persisted preload() hangs when upstream sync never calls markReady
34 additions and 10 deletionspackages/db-sqlite-persistence-core/src/persisted.tsModified
View file
@@ -828,7 +828,7 @@
private readonly mode: PersistedMode,
private readonly collectionId: string,
private readonly persistence: PersistedResolvedPersistence,
- private readonly syncMode: `eager` | `on-demand`,
+ readonly syncMode: `eager` | `on-demand`,
private readonly dbName: string,
) {}
​
@@ -2209,6 +2209,13 @@
...sourceSyncConfig,
sync: (params) => {
const transactionStack: Array<OpenSyncTransaction<T, TKey>> = []
+ const startupState = { cleanedUp: false, readySignalled: false }
+ const signalReady = () => {