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
A reliable channel ensures at-least-once guarantees via acknolwedge messages sent by both, client and server. Therefore, the client, and the server must reliably store messages that weren't acknowledged by all recipients yet. In case of the client, this means the server must respond with a last-ack-id response when messages are sent, and the client must always send the full message queue to workaround missing “in-between” updates.
Implementation
The default WebsocketProvider does not support message buffers and acknowledgment of messages. The ReliableWebsocketProvider is therefore a drop-in replacement that takes on the additional responsibilities of transparently managing a send buffer, and acknowledging message retrieval.
Due to Y.js supporting staging of messages (messages are not integrated until all necessary messages are available), and applying updates being idempotent, this isn't an issue.
sequenceDiagram
Client->>+Server: Send message buffer to server
alt no response
loop Retry (w/ exponential backoff)
Client-->>Server: Send message buffer
end
else
Server-->>-Client: Acknowledge message retrieval
end
Loading
Caveats
We aim for eventual consistency (at-least-once delivery), and similar transport latency as with the regular WebsocketProvider on the happy path (exactly-once delivery). There is a chance of transmitting messages twice, when an “older” message wasn't transmitted, but the client is producing “new” messages.
The text was updated successfully, but these errors were encountered:
Problem
A reliable channel ensures
at-least-once
guarantees viaacknolwedge
messages sent by both, client and server. Therefore, the client, and the server must reliably store messages that weren't acknowledged by all recipients yet. In case of the client, this means the server must respond with alast-ack-id
response when messages are sent, and the client must always send the full message queue to workaround missing “in-between” updates.Implementation
The default
WebsocketProvider
does not support message buffers and acknowledgment of messages. TheReliableWebsocketProvider
is therefore a drop-in replacement that takes on the additional responsibilities of transparently managing asend buffer
, andacknowledging
message retrieval.Due to Y.js supporting staging of messages (messages are not integrated until all necessary messages are available), and applying updates being idempotent, this isn't an issue.
Caveats
We aim for eventual consistency (
at-least-once
delivery), and similar transport latency as with the regularWebsocketProvider
on the happy path (exactly-once
delivery). There is a chance of transmitting messages twice, when an “older” message wasn't transmitted, but the client is producing “new” messages.The text was updated successfully, but these errors were encountered: