-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Open
Labels
enhancementNew feature or requestNew feature or request
Milestone
Description
Describe the bug
io.to([]).emit("hello") sends to everybody instead of nobody
To Reproduce
Socket.IO server version: 4.6.1
Server
import { Server } from "socket.io";
const io = new Server(3000, {});
io.on("connection", () => {
io.to([]).emit("hello");
});Socket.IO client version: 4.6.1
Client
import { io } from "socket.io-client";
const socket = io("ws://localhost:3000/", {});
socket.on("hello", () => {
console.log("hello received");
});Expected behavior
I expect no message to be sent when an empty array is passed to .to().
Platform:
- OS: macOS 13.2
Additional context
It's easy to work around, but the behavior was unexpected.
ZeroParticle
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request