y-crdt / yrs-warp

Yrs web socket data exchange protocol implementation for tokio warp server
Other
16 stars 6 forks source link

y-sync protocol doesn't broadcast updates #1

Closed Horusiath closed 1 year ago

Horusiath commented 1 year ago

Currently yrs-warp connection doesn't handle broadcasting updates to other connections. While it's not an issue when yrs web socket provider has been configured to periodically send state vector sync messages, eg.:

const options = {
  resyncInterval: 500 // set client to send sync request every 500 ms
}
const provider = new WebsocketProvider('ws://localhost:8000', 'my-room', doc, options)

This could be improved by active push driven broadcast from the server side. Since having multiple open browser tabs could mean, that the same (redundant) update will be send multiple times, we also need to take into account that gossiping the updates should handle redundant data.