feat: align ws sync behavior with librocco#2
Merged
Conversation
…nd (#1) OutboundStream.reset() was an empty stub, so when a peer detected a gap and sent RejectChanges, the server never rewound its cursor or re-sent. A peer that fell behind mid-connection (a failed or lost apply) would then silently and permanently miss changes — the gap-recovery half of the protocol was dead code, producing converged-but-not-actually-synced divergence between peers. Rewind #lastSent to the rejection's `since` and re-kick the stream so the missing range is re-delivered. Also make the IDB and Transport imports type-only (they are only used as types). Adds OutboundStream.test.ts covering the gap-recovery path: a peer that rejects at an earlier version must trigger a re-send from that point. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Summary
librocco/mainwith the ws sync behavior Librocco is currently validated againstlibrocco/sqlite3-fsnotifyValidation
VLCN_ROOT=/home/silvio/dev/vlcn-js-main-align PNPM_VERSION=9.15.9 PNPM_INSTALL_ARGS='--force --no-frozen-lockfile' DRY_RUN=true ./scripts/publish_vlcn.sh dev