You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Previously set flags on BroadcastOperator should be respected. I'd suggest following change but I am not sure about any implications this might have, thus opening this as an issue instead of a PR:
Would I think, save us some crazy extra redis usage if this could get released (please, thank you). Our pubsub traffic went a bit crazy when we updated to 4 and I think this is at least one of the causes. (Thanks for noticing this @schw4rzlicht and thanks for fixing it @darrachequesne )
Describe the bug
When using
BroadcastOperator.fetchSockets()
, flags that were set before (e.g. withio.local.fetchSockets()
→ setslocal: true
flag) are ignored.This leads to all sockets across all nodes being returned for example instead of only the local ones.
I suspect this code to be responsible:
socket.io/lib/broadcast-operator.ts
Lines 262 to 265 in 8ecfcba
To Reproduce
Socket.IO server version:
4.4.1
Server
see https://github.com/fan711/socket-server
Socket.IO client version:
4.4.1
Client
see https://github.com/fan711/socket-client
Expected behavior
Previously set flags on
BroadcastOperator
should be respected. I'd suggest following change but I am not sure about any implications this might have, thus opening this as an issue instead of a PR:.fetchSockets({ rooms: this.rooms, except: this.exceptRooms, + flags: this.flags, })
Additional context
Initially suspected https://github.com/socketio/socket.io-redis-adapter and opened socketio/socket.io-redis-adapter#454 but I am happy to close that one if this one here is confirmed.
/cc @fan711
The text was updated successfully, but these errors were encountered: