feat(adaptors): upgrade flock to 4.1.0 and use inclusiveVersion for sync check #45
+78
−78
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.