Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebSocketDiagramServer 'silently' drops larger messages from client -> server #102

Open
kdvolder opened this issue Aug 22, 2019 · 2 comments

Comments

@kdvolder
Copy link

This is probably due to some limitations in websocket implementation in the browser environment.

But we experienced that WebSocketDiagramServer silently drops messages when they go beyond a certain size. This is problematic for 'real world' diagrams. For example we found that it stopped working when we started having fairly simple graphs that have more than a dozen or so nodes. It worked fine when we only had 10 nodes or so.

Took quite a bit of guessing and trial and errror as we received no clear error messages about the packets being too large, but websockets kept getting closed shortly after the client/browser side had sent out the message that contains the 'bounds' of elements. This message never was received on the server side.

We solved this eventually by subclassing WebSocketDiagramServer and re-implementing it's sendMessage method to chop any messages larger than 4000 chars into smaller chunks and re-assembling them on the server side.

@kdvolder
Copy link
Author

FYI: Here's our custom subclass of the WebSocketDiagramServer that chops large messages into pieces.

https://github.com/kdvolder/sprotty-server-example/blob/72bbb3bc39baa121a00fd570a2bd12b493d27bd2/client/src/model.ts

@spoenemann
Copy link
Contributor

See also theia-ide/sprotty#182

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants