Skip to content

Expected behavior or bug ? #41

@DiegoMax

Description

@DiegoMax

Im working on the realtime chat module for an app, im using the redis streams adapter, when a socket leaves a room i want to notify all the other sockets about that, and here comes my quesion:

   // THIS WORKS
  (await io.in(matchRoom).fetchSockets()).forEach((s) => {
    if (s.id !== socket.id) {
      s.emit("chat:user_left");
    }
  });
  
  // THIS DOES NOT WORK WHEN THE ADAPTER IS ENABLED
  io.in(matchRoom).except(socket.id).emit("chat:user_left");

  // THIS DOES NOT WORK WHEN THE ADAPTER IS ENABLED
  socket.to(matchRoom).emit("chat:user_left");

Is this expected behavior that when using an adapter socket.to() and io.in() just silently fail and no message is sent ? or is this a bug?
Thanks.

NodeJS 22
RedisStreamsAdapter 0.2.3
Socket.IO 4.8.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions