You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`onLatency(cb): () => void` subscribes to latency updates; if a value exists, emits immediately; returns unsubscribe.
99
99
100
100
- Rooms
101
-
-`join({ roomId, crdtAdaptor, auth? }): Promise<LoroWebsocketClientRoom>` joins a room for a given CRDT type via its adaptor. Optional `auth` is forwarded to the server’s `authenticate` hook.
101
+
-`join({ roomId, crdtAdaptor, auth? }): Promise<LoroWebsocketClientRoom>` joins a room for a given CRDT type via its adaptor. Optional `auth` carries application-defined join metadata (e.g., auth/session tokens) and is forwarded to the server’s `authenticate` hook.
Copy file name to clipboardExpand all lines: protocol-e2ee.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -104,7 +104,7 @@ Rationale: An explicit random IV per record eliminates IV‑reuse risk and simpl
104
104
105
105
Req and Recv follow the same join/sync rules as `%LOR`:
106
106
107
-
- JoinRequest carries authentication and a document version (opaque to the protocol). Recv may respond with JoinResponseOk, JoinError, and may push missing updates.
107
+
- JoinRequest carries application-defined join metadata (often auth) and a document version (both opaque to the protocol). Recv may respond with JoinResponseOk, JoinError, and may push missing updates.
108
108
- When sending updates, Req packs one or more `%ELO` records into a `DocUpdate` payload. If large, use fragments per the base protocol.
109
109
- Recv broadcasts received updates to other subscribers in the same room.
Copy file name to clipboardExpand all lines: protocol.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,7 +49,7 @@ Note: Keepalive frames are special and bypass this envelope entirely. When the e
49
49
## Message Types
50
50
51
51
- 0x00: JoinRequest.
52
-
-`varBytes`authentication payload for the target room.
52
+
-`varBytes`join payload (application-defined metadata such as auth/session info).
53
53
-`varBytes` for the requester's document version.
54
54
- 0x01: JoinResponseOk.
55
55
-`varString` permission: "read" | "write".
@@ -80,9 +80,9 @@ Note: Keepalive frames are special and bypass this envelope entirely. When the e
80
80
81
81
Req sends a `JoinRequest` to Recv.
82
82
83
-
- If authentication fails, Recv sends `JoinError(code=0x02 auth_failed)`.
84
-
- If authentication succeeds but the version is unknown, Recv sends `JoinError(code=0x01 version_unknown)` and includes its version.
85
-
- If authentication succeeds, Recv sends `JoinResponseOk` with its latest known version of the document. Recv may then send the updates missing from Req through `DocUpdate` or `DocUpdateFragment` messages.
83
+
- If Recv rejects the join payload (e.g., authentication/authorization fails), it sends `JoinError(code=0x02 auth_failed)`.
84
+
- If the join payload is accepted but the version is unknown, Recv sends `JoinError(code=0x01 version_unknown)` and includes its version.
85
+
- If the join payload is accepted, Recv sends `JoinResponseOk` with its latest known version of the document. Recv may then send the updates missing from Req through `DocUpdate` or `DocUpdateFragment` messages.
86
86
87
87
When Recv receives updates in the same room from other peers, it broadcasts them to all the other peers through `DocUpdate` or `DocUpdateFragment` messages.
0 commit comments