socketio / socketio/socket.io

Adapter method should return a Promise | void

Open
#4,789 3 comments 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 Adapter method return void only that make customized adapter implementer have trouble on implementing.
E.g. io.socketsJoin() and inner adapter's method addSockets and delSockets currently return void which brings troubles for new adapter implementer as the adapter may not be able to do it synchronized.

Describe the solution you'd like
Return Promise | void instead of void and thus let adapter implementer decide whether it should be async.

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

Locate the io.socketsJoin() entry point and the adapter methods addSockets and delSockets, then trace their TypeScript signatures and callers. Update the relevant return types to support Promise | void and verify that both synchronous and asynchronous adapter implementations behave correctly through the existing test suite.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend-api-design
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.