Skip to content

Conversation

@lodyai
Copy link
Contributor

@lodyai lodyai bot commented Dec 29, 2025

Summary

Upgrade @loro-dev/flock to 4.1.0 and use the new inclusiveVersion() method for checking if local version has reached the server version.

Changes

  • 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) - unchanged
  • Use flock.inclusiveVersion() for waitForReachingServerVersion check

Why

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.

…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>
@zxch3n zxch3n merged commit b84eb63 into main Dec 29, 2025
2 checks passed
@github-actions github-actions bot mentioned this pull request Dec 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants