-
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
Socket connection is dropped on link download #4436
Comments
Hello! Could someone please answer this bug or recommend how to properly fix it |
Hi Volodymyr, I have a similar issue and found out that everything should work with socket.io-client version 3.0.5. This client version should work with the latest socket.io server version. |
Noticing this bug as well, still persisting on |
I'm experiencing this as well with client |
Same issue with client 4.5.4. |
Does anyone have a working demo where I can test this out? |
Related: socketio/socket.io#4436
Hi! I wasn't able to reproduce the issue: https://github.com/socketio/socket.io-fiddle/tree/issues/socket.io/4436 Does setting Reference: https://socket.io/docs/v4/client-options/#closeonbeforeunload |
Ran into the same problem today and later found this issue. Problem is with files that are on different host and unable to open in a browser. I.e. 'zip, exe, msi, ...' https://github.com/sladdky/socket.io-fiddle
|
Silently closing the connection when receiving a "beforeunload" event is problematic, because it is emitted: - when downloading a file from another host Related: socketio/socket.io#4436 - when the user already has a listener for the "beforeunload" event (i.e. "are you sure you want to leave this page?") Related: - #661 - #658 - socketio/socket.io#4065 That's why the `closeOnBeforeunload` option will now default to false.
Describe the bug
Socket connection drops after download is initiated via hidden href link download in chrome. Chome : Version 103.0.5060.134 (Official Build) (64-bit), but it was reproducable with any recent version
To Reproduce
I've added code in main.js (see below) that will log to console all socket events to console and extra logic that checks each sent message text === "download" resulting a hidden link to be added and clicked which initiates download of index.html with browser default file open dialog.
WORKAROUNDS:
Socket.IO server/client version:
4.5.1
Client:
full main.js code
Expected behavior
Socket connection is not dropped on download
Platform:
Additional context
The text was updated successfully, but these errors were encountered: