I have noticed a bug in the API Doc tool related to Socket.IO event handling.According

Hello Team,

I have noticed a bug in the API Doc tool related to Socket.IO event handling.

According to the Socket.IO documentation:

io.to(roomId).emit(…) → should send the message to all clients in the room, including the sender.
socket.broadcast.to(roomId).emit(…) → should send the message to all clients in the room except the sender.

However, in the API Doc tool, when I use socket.broadcast.to(roomId).emit(…), the sender is also receiving the message event, which should not happen. This behavior makes both methods (io.to and socket.broadcast.to) act the same, which is incorrect.

Steps to Reproduce:
Connect multiple clients to a room.
From one client, emit a message using socket.broadcast.to(roomId).emit(…).
Observe that the sender also receives the message, which is not expected.

Expected Behavior:
The sender should not receive the event when using socket.broadcast.to(…).

Actual Behavior:
The sender is still receiving the event.
Kindly investigate and fix this issue so that the broadcast behavior works correctly in the API Doc tool.

:x: Issue:
When I use socket.broadcast.to(roomId).emit(…), the sender is also receiving the event, which should not happen. This makes both methods behave the same.
:white_check_mark: Example Code
// Server-side
socket.on(“sendMessage”, (roomId, msg) => {
socket.broadcast.to(roomId).emit(“newMessage”, msg);
});

Expected Behavior:
If User A, B, and C are in the same room:
User A sends a message.
Only User B and C should receive it.

Actual Behavior:
User A is also receiving the event, same as io.to(roomId).emit(…).
Please check this issue and fix it so socket.broadcast.to(…) works as expected.

Thank you,
Chetan

Could you please let us know which version of the Socket.IO server library you are currently using? This will help us investigate the broadcast behavior issue more accurately.

Apidog 2.7.33

Hello Chetan,

Could you please confirm the version of the Socket.IO server library you’re currently using? We need the specific Socket.IO server version (e.g., socket.io@4.7.2) to investigate the broadcast behavior issue properly. The Apidog version you provided earlier isn’t sufficient for this technical investigation.

Thank you for your cooperation.