Skip to content

Error handling in case of messages too large #189

@pmioulet

Description

@pmioulet

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
image

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!

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions