fix(sync): a new device's first sync of a large library goes through
Some checks failed
CI / check (push) Has been cancelled

A device that had never synced a space collected everything it lacked from
the server, which read each change's domain row with a statement of its
own and sent nothing before all were read. On halkyon.li, a new device's
first sync of a library of 56,621 rows (8,190 cards, 20,961 reviews) kept
the server's one thread busy about 100 s; the client, hearing nothing for
40 s, not even the pongs to its pings, closed the stream, and every attempt
five minutes later started over, so that device never synced.

The fork of serverpod_offline_sync moves to the signed 741e334 on its
branch halkyon/batched-row-reads (stacked on halkyon/batch-inserts), which
reads those rows 500 to a statement per table and space in the same
snapshot: 120,194 changes took 51.5 to 53.6 s to collect on embedded
PostgreSQL before, 16.9 to 17.1 s after, the same bytes on the wire.

Whats-New: A new device now gets through its first sync of a large library instead of stopping and starting over.
Whats-New-De: Ein neues Gerät schafft jetzt seinen ersten Abgleich auch einer großen Bibliothek, statt abzubrechen und von vorn anzufangen.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
Tizian 「ティツィアーン」 2026-11-09 15:47:36 +01:00
commit 0cd329566f
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64

File diff suppressed because one or more lines are too long