You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(clerk): poll allDocs after attach to kick CRDT sync processing
database.attach() resolves when the WebSocket connects, but historical
data streams in asynchronously. The streamed metadata isn't processed
until something queries the database, so useLiveQuery never sees the
data on a second device without a manual refresh.
A periodic allDocs() call after attach forces the CRDT to process
pending sync metadata, advancing the clock and triggering subscriptions.
Polling stops once the document count stabilizes (3 consecutive polls
unchanged) or after 20 seconds — whichever comes first. After that,
real-time updates flow through the normal subscription path.
Typical cost: 4-5 IndexedDB reads, then done.
0 commit comments