Repository navigation
feat(sync): fetch only the changes the remote's events say moved - #130
Open
PiquelChips wants to merge 1 commit into
Open
PiquelChips wants to merge 1 commit into
PiquelChips wants to merge 1 commit into
Conversation
|
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 34 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. |
PiquelChips
force-pushed
the
feat/sync-fetch-cursor
branch
from
November 22, 2026 15:04
a1ebb3a to
4be9738
Compare
PiquelChips
force-pushed
the
feat/sync-fetch-cursor
branch
2 times, most recently
from
November 22, 2026 18:54
74b2bab to
a9aaec8
Compare
Comparing every change this node knows with the remote's makes a fetch that brings nothing grow with history. `Sync::fetch` reads the remote's events since the cursor of the last fetch first, and compares only the changes they say moved: those with a revision created or a statement issued about them, or about a statement about them, traced through the events and then this node's records. Read first, so what moves while it fetches is fetched again. Without a cursor, or once the remote no longer keeps its events, every change is compared. A cursor is a sequence number of the remote's op log, which only means something in that log: a repository restored from a copy of its records starts a new one, whose numbers may run behind. So each op log now has a generation, a random id made with it. Event pages carry it, and a query naming another generation is refused as expired, which sends the fetch back to a full comparison.
PiquelChips
force-pushed
the
feat/sync-fetch-cursor
branch
from
November 22, 2026 19:20
a9aaec8 to
6d1c688
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Comparing every change with the remote's makes a fetch that brings nothing grow with history.
Fetch:
Cursor generation: the cursor is tied to the remote op log's generation, and falls back to a full comparison when it's stale.
Benchmark (local HTTP): a fetch that brings nothing from 10k changes takes 0.7 ms.
Note
Written by Claude Opus 5.5 in Claude Code (via T3 Code)