Not calling next on io.of('/test') middleware does not timeout or error
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 63.2k
- Forks
- 10.3k
- Avg merge
- 11d 20h
- Merged PRs (30d)
- 2
Description
In the following code server side:
io.of('/test').use(function(socket, next){
console.log("Authenticating...")
//next();
});
A socket.io connecting to the /test namespace will never connect (obviously), but it will never either get a timeout or error, it will just be in a pre-connection state for ever. Seems like an innocuous bug but its not, in my example next is not called explicitly, but if the code before next throws an exception for example you will get the same result on the client side.
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 by reproducing the server-side io.of('/test').use middleware example and observe the client when next is never called or middleware code throws. Trace the namespace middleware connection path and add coverage for the expected timeout or error behavior, then verify that the client no longer remains in a pre-connection state indefinitely.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js, typescript
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100