Describe the bug
If the server replies with an error, yjs disconnects, reconnects and sends the message again.
In my case the message is being rejected because the size of the message is too large

When the message is sent again, it will fail again because it is still too large.
To Reproduce
Use for example spring gateway that has a limit on websocket message sizes.
Expected behavior
I would like to pass an error handler and managed the errors and avoid disconnects when not required. Ideally the messages should be split to avoid the error above
Environment Information
- Firefox
- "y-websocket": "^2.0.4"
Additional context
I'm using yjs with lexical and this issue appears if i import a large document in lexical. Simply increasing the size of the WS message buffer on the server side is not an option as it consumes too much memory resources on the server side.
Thanks!
Describe the bug
If the server replies with an error, yjs disconnects, reconnects and sends the message again.
In my case the message is being rejected because the size of the message is too large

When the message is sent again, it will fail again because it is still too large.
To Reproduce
Use for example spring gateway that has a limit on websocket message sizes.
Expected behavior
I would like to pass an error handler and managed the errors and avoid disconnects when not required. Ideally the messages should be split to avoid the error above
Environment Information
Additional context
I'm using yjs with lexical and this issue appears if i import a large document in lexical. Simply increasing the size of the WS message buffer on the server side is not an option as it consumes too much memory resources on the server side.
Thanks!