socketio / socketio/socket.io

Cannot catch websocket error

Open
#5,102 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

package:socket.io-client
Dominant language
TypeScript
Stars
63.2k
Forks
10.3k
Avg merge
11d 20h
Merged PRs (30d)
2

Description

You want to:
  • report a bug
  • request a feature
Current behaviour

What is actually happening?
When an unhanded websocket error is thrown (transport.js 64), there does not appear to be a way to prevent the node.js application from crashing.

Steps to reproduce (if the current behaviour is a bug)
  1. Connect your socket.io client to a socket.io server
  2. Connect a device to your network that has the same IP address as your socket.io server
  3. Disconnect your socket.io server from the network
  4. The socket.io client will crash with this error.
Expected behaviour

The socket.io client would disconnect, and then go into a reconnecting state.

Setup
  • OS: Windows Server 2012 R2
  • browser: Node.js
  • socket.io version: 2.1.1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at transport.js line 64 and reproduce the failure with the listed network-disconnect steps in a Node.js client. Trace how the websocket error is handled and verify that the client disconnects and enters a reconnecting state instead of crashing the application.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.