-
-
Notifications
You must be signed in to change notification settings - Fork 757
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
Clearing socket.io send buffer after connection timeout #1532
Comments
I'm wondering if there should be a manual timeout anymore at all. This was originally needed if e.g. you called a service method that didn't exist but with the new Socket format you will get an error right away in that case. |
I'm still on Buzzard/v3 so don't know how your v4 arch changes impact on this. In my scenario, I am debugging/stepping through code on the server, |
I believe I am experiencing this as well. I have experienced the issue above as well as some odd 401's when paired with authentication. I created a basic repo where this can be reproduced easily: https://github.com/DaddyWarbucks/feathers-auth-test |
I can confirm this is not a bug with feathers or feathers-authentication, as I initially thought. This is the natural behavior of how the socket.io client works. The fix mentioned above by @TimNZ works, or more compactly:
I was receiving authentication errors due to this because the More information can be found here: |
The question would be if that should be included in the clients. I would think so, potentially together with #1537 |
It would be helpful to be able to set the timeout option to null as well to disable it completely and use the built-in socket.io functionality. |
This has been closed in the v5 prerelease via #1937 |
Tip for people who may not be aware of this behaviour.
Below is my code for a browser client.
An unexpected behaviour I just discovered is after the error hooks are called on a socket disconnect, I had presumed that any messages that had failed to be sent during the timeout window were subsequently discarded.
This is not the case - socket.io adds them to a buffer and will resend when the connection is restored.
This is unwanted behaviour as I have already indicated to the user their action has failed e.g. a Signup.
Now I clear the socket.io sendBuffer on connect if detected a disconnect previously
Should this be something Feathers supports via an explicit option, or at least document?
https://stackoverflow.com/questions/32131629/socket-io-stop-re-emitting-event-after-x-seconds-first-failed-attempt-to-get-a-r/32261523#32261523
The text was updated successfully, but these errors were encountered: