mirror of
https://github.com/getpaseo/paseo.git
synced 2026-11-21 15:55:58 +00:00
A host could keep a current directory checkpoint in the replica cache with none of the rows it described. The daemon then answered "no changes" since that cursor, and the sidebar had no projects to place cached workspaces under, so every workspace for that host vanished and stayed missing across restarts. The cache already refused mutations for an evicted host, but it checked at the moment a mutation was queued. Eviction happens later, inside the serialized write, so anything queued before the eviction ran was still written, checkpoint included. The check moves into materializePendingChanges so it runs in the same serialized step that evicts, which also covers an eviction that lands while an earlier persist is still indexing the store. Checking at queue time was also losing good data: once a host was invalidated, every mutation was dropped, including updates accepted between a reconnect's baseline replacement and its write. Those are kept now, because the baseline is in the same pending batch. Version 1 checkpoints could have been written by that path, so they are no longer trusted. A reader discards them and keeps the cached rows, so the sidebar still paints from cache and each host re-syncs its directory once. Later launches resume incrementally. Both the race and the recovery live in the shared cache, so this covers iOS, Android, web, and Electron. It does not address two tabs or windows sharing one IndexedDB database, where another connection evicts the host.