Skip to content

Conversation

@lodyai
Copy link
Contributor

@lodyai lodyai bot commented Jan 4, 2026

Summary

Add a new public method sendExternalUpdates() to LoroWebsocketClient that allows users to send additional updates to a specified room that are not from the local peer's document.

Changes

  • Added sendExternalUpdates(crdt, roomId, updates) method to LoroWebsocketClient
  • The method validates that the room is active and WebSocket is open before sending
  • Uses existing sendUpdateOrFragments() for proper fragmentation handling of large payloads

Use Case

This is useful for forwarding updates received from other sources or peers to a room, enabling scenarios where updates need to be relayed without originating from the local document.

API

sendExternalUpdates(
  crdt: CrdtType,
  roomId: string,
  updates: Uint8Array[]
): void
  • crdt: The CRDT type of the room
  • roomId: The room ID to send updates to
  • updates: Array of update payloads to send
  • Throws Error if not connected or room is not active

…Client

Add a new public method sendExternalUpdates() that allows users to send
additional updates to a specified room that are not from the local peer's
document. This is useful for forwarding updates received from other
sources or peers.

The method:
- Takes crdt type, roomId, and an array of update payloads
- Validates that the room is active and WebSocket is open
- Uses existing sendUpdateOrFragments() for proper fragmentation handling
- Throws descriptive errors if preconditions are not met

Co-authored-by: lody <agent@lody.ai>
@lodyai lodyai bot force-pushed the session/fceeafb0-9ccd-4845-9767-ba96bb4315f7 branch from e9e4092 to 5860dc0 Compare January 4, 2026 04:07
@zxch3n zxch3n merged commit c263c8b into main Jan 4, 2026
2 checks passed
@github-actions github-actions bot mentioned this pull request Jan 4, 2026
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