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

Socket.io-client fires "connect" event but can't send events to server #1567

Open
alexasparks opened this issue Dec 15, 2022 · 0 comments
Open
Labels
to triage Waiting to be triaged by a member of the team

Comments

@alexasparks
Copy link

alexasparks commented Dec 15, 2022

Describe the bug

If I leave my site domain and use the browser back button to return socket.io-client fires the "connect" event, but the client socket can't send any events to the server until the connection is disconnected and then reconnects or I refresh the page.

To Reproduce

Please fill the following code example:

Socket.IO server version: 4.5.4
Socket.IO client version: 4.5.4

Link to repl: https://replit.com/@ambil/socket-io-bug-example#index.js

  1. Click "Open website" to run code fiddle in a new browser tab
  2. Click the "Test Event" button. You'll see a new message appended to the list with each click that says: "event: button_clicked"
  3. In the same browser tab, navigate to a new domain (ex: google.com)
  4. Use the browser back button to navigate back to the previous tab
  5. Without refreshing the page, click the "Test Event" button. Notice a new message is not appended to the list, although the status shows "Connected"

Expected behavior
Since the client is firing off the "connect" event, I'd expect the server to acknowledge client events right away.

Platform:

  • Chrome for MacOS
@alexasparks alexasparks added the to triage Waiting to be triaged by a member of the team label Dec 15, 2022
@alexasparks alexasparks changed the title Socket.io-client fires "connect" event but is sometimes misleading Socket.io-client fires "connect" event but can't send events to server Dec 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
to triage Waiting to be triaged by a member of the team
Projects
None yet
Development

No branches or pull requests

1 participant