-
Notifications
You must be signed in to change notification settings - Fork 376
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
Calling 'stop()' sometimes leads to the client being 'disconnected' #956
Comments
Would be nice to have a way to reproduce. Anyhow - could you check if the following fixes the problem: #967 |
Did you mean the |
Thank you for your reply! I do not think I can provide a way to reproduce, as this happens only sometimes with our quite complex setup that I cannot share publicly, sorry. I noticed this problem with the
Thanks! I think the changes looks nice, but I do not think it would solve the problem I described:
Of course, I'm not very proficient with the code base here, so I might have missed some side effect of your proposed changes that would solve the problem 🙇
Yes, sorry for the confusion! |
Describe the bug
When calling
stop()
, we expect the client to end up in the 'offline' status, but sometimes (somewhat extreme network environment?) the 'offline' event is triggered before the 'disconnected' one, which will then keep the 'disconnected' until other actions are triggered. If the reconnect package/plugin is used, it will identify this state as necessitating re-connection and will try to perform a re-connection (which will usually not succeed)Logs
Environment
This is obtained by running our application through some integration testing (cypress 10.3.1 + Chrome 104.0.5112.79, observed on both CI (ubuntu), Mac, and Linux (Arch) computers)
Possible Solutions and workaround
One possible solution would be to not mark the 'disconnected' state if we are currently in
offline
state, maybe on the connection package we could do something such as:Otherwise for now, as a workaround, we will disable the reconnect mechanism after explicitly calling the client stop method to avoid the client trying to reconnect (but it will still be left in an unexpected state/status):
The text was updated successfully, but these errors were encountered: