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

Issue when reconnect socket #126

Open
InoueKenta opened this issue May 7, 2020 · 0 comments
Open

Issue when reconnect socket #126

InoueKenta opened this issue May 7, 2020 · 0 comments

Comments

@InoueKenta
Copy link

I have a SPA which using sailjs and vuejs.
I got an issue when trying to reconect after go to a new view.
The issue is that I try to destroy all old listeners and reassign new event listener by using
io.socket.removeAllListeners();

but then I was struggling because the socket still queue old events.
Then I found out that the removeAllListeners(); methods only revoke _raw io object events but not the eventQueue object.

I managed to fix the issue by calling io.socket.eventQueue = {}.
I just wonder why the eventQueue is still remain and should I change it manually

return this;

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

No branches or pull requests

1 participant