Conversation
…ync check - Update @loro-dev/flock peerDependency to ^4.1.0 in loro-adaptors - Update @loro-dev/flock devDependency to ^4.1.0 in loro-websocket - Use flock.version() for encoding (sending to server) - Use flock.inclusiveVersion() for waitForReachingServerVersion check The inclusiveVersion() includes all peers ever seen, making it correct for checking if we have received all data from the server, while version() only includes peers with current entries, which is correct for incremental sync. Co-authored-by: lody <agent@lody.ai>
Merged
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
Upgrade
@loro-dev/flockto 4.1.0 and use the newinclusiveVersion()method for checking if local version has reached the server version.Changes
@loro-dev/flockpeerDependency to^4.1.0inloro-adaptors@loro-dev/flockdevDependency to^4.1.0inloro-websocketflock.version()for encoding (sending to server) - unchangedflock.inclusiveVersion()forwaitForReachingServerVersioncheckWhy
According to flock 4.1.0 API:
version(): Returns the exclusive version vector, which only includes peers that have at least one entry in the current state. Use this version when sending to other peers for incremental sync.inclusiveVersion(): Returns the inclusive version vector, which includes all peers ever seen, even if their entries have been overridden by other peers. Use this version when checking if you have received all data from another peer.The
inclusiveVersion()is the correct choice for checking if we have received all server data, as it includes all peers ever seen rather than just peers with current entries.