Cannot catch websocket error
Open
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)
- Connect your socket.io client to a socket.io server
- Connect a device to your network that has the same IP address as your socket.io server
- Disconnect your socket.io server from the network
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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