yjs / y-webrtc

WebRTC Connector for Yjs
MIT License
448 stars 109 forks source link

Error when updating text field with long string #42

Open buesing opened 1 year ago

buesing commented 1 year ago

Checklist

Describe the bug I'm adding a long string (~300K characters) to a Y.Text type, which causes webrtc errors to show (ERR_SET_REMOTE_DESCRIPTION) on the other clients. The text is never synced. Interestingly, it's possible to add an even longer string by adding it in smaller increments.

I'm not sure if there is an inherent limit to updates when using y-webrtc, I couldn't find anything documented, so I'm filing this as a bug.

Bonus question: is there some way to catch these types of errors so I can display an error message? This is a contrived example but I'm actually running into a variation of this error in the application I'm building.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://codesandbox.io/s/cranky-framework-qmsorf?file=/src/index.js
  2. Open the sandbox again on another machine or another browser
  3. In first window, Click on "Add long string"
  4. Open console of the other window
  5. See error, and observe that the string is not synced.

As mentioned, it's easily possible to sync a string that is longer than 500k chars by repeatedly using the "Add short string" button, but adding the long string at once seems to cause problems.

Expected behavior The string should be synced and no error thrown.

Environment Information Happens in Chrome and FF

jeffrafter commented 1 year ago

This is likely a duplicate of https://github.com/yjs/y-webrtc/issues/20