Repository navigation
Phase 3 slice 4: client-driven note checkpoints + cold-open hydration (#3819) - #10843
Conversation
…slice 4) Publication moves from session-end (which would sign the session base text, since the server never applies steps to the document) to a client-driven Checkpoint message carrying the live text; Checkpointed replies with the new head. Reopened note sessions hydrate from the checkpoint log head via the blob store. Wire-level round-trip test plus unit tests; 692 id-web lib tests pass.
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 37 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Summary
Phase 3 (#3819) slice 4: wire-level note checkpoints — client-driven publication, and hydration of reopened note sessions from the checkpoint log.
Slices 1–2 (#10808, #10831) built the signed checkpoint log and wired note sessions (
note:<hex>doc IDs) into the collab WebSocket handler, publishing the session document when the last editor disconnected. Building this slice surfaced a semantic problem with that trigger: the server never applies editor steps to the session document — steps are stored and broadcast, and the document a socket holds is the session's base content. Publishing at disconnect would therefore sign the stale base text as a new revision after any step edit. Slice 4 corrects the trigger instead of shipping that:CollabMessagevariantsCheckpoint { text }(tag 10, client → server) andCheckpointed { head }(tag 11, server → client). The client, which holds the live step-edited content, sends its current text; the handler records it through the slice-2 checkpoint core (publish_note_checkpoint_text) under the server identity's author key, stores the bytes in the blob store under their document hash, and replies with the new head. Filename sessions refuse with anErrormessage. The disconnect-time publication is removed, with the reason recorded in the cleanup path.DocumentRef's content hash is the blob's hash). This is the cold-open path: a session document outlives its last client by a one-hour cleanup grace period (DOCUMENT_CLEANUP), so hydration serves opens after eviction or a server restart, and the recorded media type supplies the filename hint mode detection needs. Concurrent heads hydrate deterministically from the smallest head ID; the heads themselves are untouched.CollabState::note_head_contentexposes the lookup;publish_note_checkpoint(base-document text) is kept for server-side callers and now shares the text core.Checkpoint→Checkpointedwith a 64-hex head → exactly one durable event → eviction (theremove_documentthe cleanup task performs) → cold reopen hydrates the checkpointed text intoInit→ filename session refuses checkpoints. Plus unit tests for publish-by-text (records the given text, not the base document), head-content tracking across publications and forks, and message round-trips for the new variants.Remaining for #3819: slice 3 (access boundary at checkpoint time, per the recorded Q2 answer on #2048: public by default, read/write/admin scoped to groups and users).
Tests
cargo test -p id-web --lib— 692 passed, 0 failed (includes the 4 new slice-4 tests and all slice 1–2 collab tests).Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.