socket.io
socket.io copied to clipboard
this.join() in _onconnect() and this.leaveAll() in _cleanup should be asynchronized
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
Hey, can I work on this