01
Reconciling live collaborative state with persisted state
Why it’s hard
The Liveblocks/Yjs session and the Postgres-backed autosave are two sources of truth that must agree. A late-returning save can clobber newer content, and a reload can race the room hydration.
Resolution
Saves are serialized through a coalescing latch, so an in-flight save cannot be overwritten by a stale one. A seeding guard prevents an empty document from being silently re-seeded over live state on reload.



