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

socket.rooms array incorrect after leaving room when in multiple rooms #1697

Closed
Marreck opened this issue Jul 29, 2014 · 0 comments
Closed

Comments

@Marreck
Copy link

Marreck commented Jul 29, 2014

There is an error in socket.js which cause unexpected behaviour when a socket is in multiple rooms and leaves one of them. In some cases socket.rooms doesn't reflect the rooms the socket is actually in anymore.

the line:

self.rooms.splice(self.rooms.indexOf(room, 1));

should be:

self.rooms.splice(self.rooms.indexOf(room), 1);

Also when using socket.leaveAll, socket.rooms doesn't get cleared. self.rooms = []; should be added there.

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

1 participant