Closed volodymyr-ilnytskyi-tfs closed 2 weeks ago
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 4.5.3
, our socket disconnects once a download link is clicked
I'm experiencing this as well with client 4.6.1
.
Same issue with client 4.5.4.
Does anyone have a working demo where I can test this out?
Hi! I wasn't able to reproduce the issue: https://github.com/socketio/socket.io-fiddle/tree/issues/socket.io/4436
Does setting closeOnBeforeunload: false
have an impact?
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
target="_blank"
(but it might be blocked anyway as popup)....
a.download = ''
a.click()
socket.disconnect() //call disconnect first, client still thinks it's connected
socket.connect()
For future readers:
The closeOnBeforeunload
option now defaults to false
since socket.io-client@4.7.1
.
Reference: https://socket.io/docs/v4/client-options/#closeonbeforeunload
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