-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Room leaving not synced with the cluster on disconnect. #831
Comments
I am experiencing this issue as well |
looks like this also happens for custom events too, only gets pushed to one instance |
Confirm this. Using this.store.publish('leave', id, room); solved it for me. |
got this issue with current what's available on npm. disconnects would leave the default room "" populated. "Or inside Manager.prototype.onClientDisconnect: |
Why is this still not official? |
I face the same problem, any solution? |
Disconnects cause a socket to leave all rooms, but these leaves are not broadcast, so other workers never remove a disconnected socket from their rooms array.
Simple cluster test:
Sample from opening in browser, and refreshing once:
There are two fixes I've tried that work, but I'm unsure as to which is the best solution:
Inside the room leaving loop of Manager.prototype.onDisconnect:
Or inside Manager.prototype.onClientDisconnect:
I notice that most of the client disconnection sync is done via
'disconnect:' + id
, which is the reason why the disconnections aren't picked up by other workers. Is there a strong reason not to use globally published disconnect events?The text was updated successfully, but these errors were encountered: