socket.io icon indicating copy to clipboard operation
socket.io copied to clipboard

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

Open zackliu opened this issue 1 year ago • 1 comments

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.

  • _onconnect(): https://github.com/socketio/socket.io/blob/main/lib/socket.ts#L603
  • _cleanup(): https://github.com/socketio/socket.io/blob/main/lib/socket.ts#L760

zackliu avatar Aug 14 '23 08:08 zackliu

Hey, can I work on this

NextThread avatar Aug 29 '23 05:08 NextThread