Align editor and server sync protocol (one socket, durability acks, lineage) #29

Closed
opened 2026-10-13 16:19:10 +00:00 by kayg · 0 comments
Owner

The editor (#7, PR #25) and the server rooms (#6, PR #28) were built in parallel and speak slightly different sync contracts. Align them so the real web app syncs with the real server.

  • Server (#6): note sync is multiplexed over the one live websocket. Frames are a lib0 var-string room name followed by one y-protocols message; a room is joined with {"type":"join"}.
  • Client (#7): a separate websocket per note at /api/v1/notes/<id>/sync?lineage=, plus durability acks (100 <id> → 101 <id> only after the change is durable) and close code 4409 on a lineage mismatch.

Target, per ADR 0012 (one socket per client): the multiplexed server transport, extended with the durability ack and the lineage check that the client needs for honest "Saved" and the offline replay guards. Replace the editor's test-server with the real binary in e2e. Every guard test from both sides stays green.

The editor (#7, PR #25) and the server rooms (#6, PR #28) were built in parallel and speak slightly different sync contracts. Align them so the real web app syncs with the real server. - **Server (#6):** note sync is multiplexed over the one live websocket. Frames are a lib0 var-string room name followed by one y-protocols message; a room is joined with `{"type":"join"}`. - **Client (#7):** a separate websocket per note at `/api/v1/notes/<id>/sync?lineage=`, plus durability acks (`100 <id>` → `101 <id>` only after the change is durable) and close code 4409 on a lineage mismatch. Target, per ADR 0012 (one socket per client): the multiplexed server transport, extended with the durability ack and the lineage check that the client needs for honest "Saved" and the offline replay guards. Replace the editor's test-server with the real binary in e2e. Every guard test from both sides stays green.
kayg closed this issue 2026-10-13 18:26:08 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal#29
No description provided.