Skip to content

Conversation

@nvie
Copy link
Contributor

@nvie nvie commented Dec 22, 2025

This PR renames and documents the OpSource enum values for clarity:

  • UNDOREDO_RECONNECTLOCAL
  • REMOTETHEIRS
  • ACKOURS

Also, this PR adds preparatory type definitions for the upcoming protocol V8, including a new StorageAckServerMsg message type. (This undoes my prior approach from #2932, I figured we actually need a new message type.)

These types are not used/implemented yet.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves documentation and prepares for protocol V8 by renaming OpSource enum values to be more intuitive and adding type definitions for a new acknowledgment message.

  • Renamed OpSource enum values: UNDOREDO_RECONNECTLOCAL, REMOTETHEIRS, ACKOURS
  • Consolidated AckOpV7 and AckOpV8 into a single AckOp type with updated documentation
  • Added StorageAckServerMsg type definition for future protocol V8 support

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/liveblocks-core/src/crdts/AbstractCrdt.ts Added comprehensive JSDoc comments for the renamed OpSource enum values (LOCAL, THEIRS, OURS) explaining their purpose in CRDT conflict resolution
packages/liveblocks-core/src/protocol/Op.ts Consolidated AckOpV7 and AckOpV8 into single AckOp type, renamed isAck to isAckOp, and updated comments to clarify V7 vs V8 protocol differences
packages/liveblocks-core/src/protocol/ServerMsg.ts Added new STORAGE_ACK message code (202) and StorageAckServerMsg type definition for protocol V8 acknowledgments
packages/liveblocks-core/src/room.ts Updated all OpSource references to use new enum names, renamed isAck to isAckOp, added inline comments for isLocal parameters, and added TODO comments linking V8 protocol migration to removal of isAckOp check
packages/liveblocks-core/src/crdts/LiveObject.ts Updated OpSource.UNDOREDO_RECONNECT to OpSource.LOCAL
packages/liveblocks-core/src/crdts/LiveMap.ts Updated OpSource.ACK to OpSource.OURS and OpSource.REMOTE to OpSource.THEIRS
packages/liveblocks-core/src/crdts/LiveList.ts Updated all OpSource references to use new enum names throughout list operation handling
packages/liveblocks-core/src/index.ts Updated exports to reflect consolidated AckOp type and added StorageAckServerMsg to public API

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants