socketio / socketio/socket.io

this.join() in _onconnect() and this.leaveAll() in _cleanup should be asynchronized

Open
#4,796 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
63.2k
Forks
10.3k
Avg merge
11d 20h
Merged PRs (30d)
2

Description

Is your feature request related to a problem? Please describe.
Some codes in socket.io doesn't await on Promise<void>. E.g. this.join() in _onconnect() and this.leaveAll() in _cleanup
Although the built-in adapter can finish them synchronizedly, but not all the customized adapters can finish them sync. Especially some method in adapter's interface can return Promise<void>

Describe the solution you'd like
A clear and concise description of what you want to happen.

Codes that invoke async method should await to guarantee order.
E.g.

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 in lib/socket.ts at the _onconnect() and _cleanup() locations linked in the issue, and trace the adapter calls made there. Ensure those asynchronous operations are awaited so their ordering is guaranteed; done means both paths handle Promise implementations correctly.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.