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
Describe the bug
On server-side, socket leaves its default room, joins a different room, then socket.to(newRoom).emit() is emitting message back to the calling socket when it shouldn't.
To Reproduce
Socket.IO server version: 4.8.1
Server
import{Server}from"socket.io";constio=newServer(3000,{});io.on("connection",(socket)=>{socket.on("foo",async()=>{awaitsocket.leave(socket.id);awaitsocket.join("7a4ccc57-96b4-45a3-963f-02cc1512ce0d");// This line emits back to sending socket, which goes against the documentation for socket.to().emit();socket.to("7a4ccc57-96b4-45a3-963f-02cc1512ce0d").emit("foo","response");})});
Describe the bug
On server-side, socket leaves its default room, joins a different room, then socket.to(newRoom).emit() is emitting message back to the calling socket when it shouldn't.
To Reproduce
Socket.IO server version:
4.8.1
Server
Socket.IO client version:
4.8.1
Client
The text was updated successfully, but these errors were encountered: