From 0b8737b07c97fa34355a8f969ddef113152fc85e Mon Sep 17 00:00:00 2001 From: Alec Watts Date: Sat, 21 Nov 2026 14:32:57 -0800 Subject: [PATCH 1/3] docs: explain shared SQLite restore timing --- docs/guides/sqlite-persistence.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/guides/sqlite-persistence.md b/docs/guides/sqlite-persistence.md index 68098b3c2d..51e390860e 100644 --- a/docs/guides/sqlite-persistence.md +++ b/docs/guides/sqlite-persistence.md @@ -264,6 +264,18 @@ persistedCollectionOptions({ A Collection with restored rows then becomes `ready` from them immediately. Network sync continues, and its changes apply over the restored rows when they arrive. An empty restore still waits for the network, so the Collection never shows an empty list that the network did not confirm. An on-demand Collection applies this to each query demand, as [On-demand Collections offline](#on-demand-collections-offline) describes. +The timeout controls when a completed restore can make an eager Collection +ready. On a shared SQLite database, a restore may wait for a running +transaction. A fast source can deliver a large snapshot whose durable write +delays another Collection's restore. A screen that waits for several +Collections can therefore stay loading after the first cache restore completes. + +When tuning reload performance, measure the time to the first usable render +with both a fast source and a held network response. On a screen with several +Collections, measure readiness for each one to see which restore the screen +is waiting for. The sync adapter still controls which rows it requests from +the server, including whether it can resume from a saved position. + The status is the only signal. Every hook, Suspense, and `preload()` follow it, so you do not need a separate persisted flag: ```tsx From 5a8b80bd5b183abbacb32b6d92e72a766b7ee2a0 Mon Sep 17 00:00:00 2001 From: Alec Watts Date: Sat, 21 Nov 2026 14:42:55 -0800 Subject: [PATCH 2/3] docs: distinguish restore completion from readiness --- docs/guides/sqlite-persistence.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/guides/sqlite-persistence.md b/docs/guides/sqlite-persistence.md index 51e390860e..8c7da6832a 100644 --- a/docs/guides/sqlite-persistence.md +++ b/docs/guides/sqlite-persistence.md @@ -271,10 +271,11 @@ delays another Collection's restore. A screen that waits for several Collections can therefore stay loading after the first cache restore completes. When tuning reload performance, measure the time to the first usable render -with both a fast source and a held network response. On a screen with several -Collections, measure readiness for each one to see which restore the screen -is waiting for. The sync adapter still controls which rows it requests from -the server, including whether it can resume from a saved position. +with both a fast source and a held network response. For each Collection on +the screen, time the SQLite restore and the transition to `ready` separately. +A restore can finish with zero rows while the Collection still waits for +the source. The sync adapter controls which rows it requests from the server, +including whether it can resume from a saved position. The status is the only signal. Every hook, Suspense, and `preload()` follow it, so you do not need a separate persisted flag: From 8ca9c63ed94a3342c4724336312569bff1eb97e3 Mon Sep 17 00:00:00 2001 From: Alec Watts Date: Sat, 21 Nov 2026 14:46:33 -0800 Subject: [PATCH 3/3] docs: explain how queued startup uses the network-first window --- docs/guides/sqlite-persistence.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/guides/sqlite-persistence.md b/docs/guides/sqlite-persistence.md index 8c7da6832a..117be5d839 100644 --- a/docs/guides/sqlite-persistence.md +++ b/docs/guides/sqlite-persistence.md @@ -264,10 +264,14 @@ persistedCollectionOptions({ A Collection with restored rows then becomes `ready` from them immediately. Network sync continues, and its changes apply over the restored rows when they arrive. An empty restore still waits for the network, so the Collection never shows an empty list that the network did not confirm. An on-demand Collection applies this to each query demand, as [On-demand Collections offline](#on-demand-collections-offline) describes. -The timeout controls when a completed restore can make an eager Collection -ready. On a shared SQLite database, a restore may wait for a running -transaction. A fast source can deliver a large snapshot whose durable write -delays another Collection's restore. A screen that waits for several +The eager timeout starts when the persistence wrapper starts. The source +starts after the wrapper loads its startup metadata, so time spent waiting +for SQLite can use part or all of the network-first window. + +Collections that share a SQLite driver in one runtime queue their SQLite work. +A large snapshot write can delay another Collection's startup metadata read +or restore. Applying a source snapshot can also require a durable write before +the source can mark the Collection ready. A screen that waits for several Collections can therefore stay loading after the first cache restore completes. When tuning reload performance, measure the time to the first usable render