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

Server handles messages out-of-order when beforeHandleMessage is used #880

Open
raimohanska opened this issue Nov 22, 2024 · 0 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@raimohanska
Copy link

Description

If you use an asynchronous beforeHandleMessage hook, you will very likely have messages handled out-of-order. In here there's no mechanism for guaranteeing processing order.

In many cases this is not an issue, but sometimes it leads to inconsistent transient states when processing Y.js updates out of order. I'm not sure what other effects this may have, as this affects all other incoming WebSocket messages as well.

My suggestion would be to guarantee processing order using a queue mechanism.

Steps to reproduce the bug

Add an asynchronous beforeHandleMessage hook. For worst case, add big random delays in your hook to mess up message processing order totally.

Expected behavior

I would expect messages to be processed FIFO.

@raimohanska raimohanska added the bug Something isn't working label Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants