From e08a48fb85cf6cc204fe338502f2f3264c3ce7f6 Mon Sep 17 00:00:00 2001 From: Test Date: Wed, 28 Oct 2026 12:49:34 -0600 Subject: [PATCH 1/2] docs(persistence): document networkTimeoutMs: 0 for cache-first rendering Co-authored-by: Isaac --- docs/guides/sqlite-persistence.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/guides/sqlite-persistence.md b/docs/guides/sqlite-persistence.md index feea3f9954..b89b6e1a7b 100644 --- a/docs/guides/sqlite-persistence.md +++ b/docs/guides/sqlite-persistence.md @@ -251,6 +251,14 @@ With `initialRender: { strategy: 'network-first', networkTimeoutMs }`, the Colle - the SQLite restore completed and installed at least one row, and - the deadline passed, or the sync adapter failed its first load. +To render cached rows as soon as the restore completes, set `networkTimeoutMs: 0`. Use this when a fast first render is more important than fresh data: + +```ts +initialRender: { strategy: 'network-first', networkTimeoutMs: 0 }, +``` + +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 status is the only signal. Every hook, Suspense, and `preload()` follow it, so you do not need a separate persisted flag: ```tsx From 4c90394042dda8dde31e8dc5409d1a61ec7304f8 Mon Sep 17 00:00:00 2001 From: Test Date: Wed, 28 Oct 2026 15:58:41 -0600 Subject: [PATCH 2/2] docs(persistence): make the networkTimeoutMs: 0 example parse The doc-snippet check rejected the bare object-property fence. Show the option inside a persistedCollectionOptions call instead. Co-authored-by: Isaac --- docs/guides/sqlite-persistence.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/guides/sqlite-persistence.md b/docs/guides/sqlite-persistence.md index b89b6e1a7b..68098b3c2d 100644 --- a/docs/guides/sqlite-persistence.md +++ b/docs/guides/sqlite-persistence.md @@ -254,7 +254,12 @@ With `initialRender: { strategy: 'network-first', networkTimeoutMs }`, the Colle To render cached rows as soon as the restore completes, set `networkTimeoutMs: 0`. Use this when a fast first render is more important than fresh data: ```ts -initialRender: { strategy: 'network-first', networkTimeoutMs: 0 }, +persistedCollectionOptions({ + ...todoSyncOptions, + persistence: syncedPersistence, + schemaVersion: 1, + initialRender: { strategy: 'network-first', networkTimeoutMs: 0 }, +}) ``` 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.