Skip to content

Uncaught TypeError: Object #<Namespace> has no method 'clients' #1450

@chriskilding

Description

@chriskilding

The ability to get all clients in a room with the following calls described in the wiki has been broken:

  • io.sockets.clients('room')
  • io.of('namespace').clients('room')

If you run the following test, it will fail when run against the latest git master with the reason "Uncaught TypeError: Object # has no method 'clients'":

it('should return the sockets in a room', function(done){
var srv = http();
var sio = io(srv);
var roomId = 'socketsInRoom';

sio.on('connect', function (socket) {
  socket.join(roomId, function () {
    expect(sio.sockets.clients(roomId)).to.contain(socket);
    done();
  });
});

srv.listen(function(){
  client(srv);
});
});

Was this functionality removed intentionally, or just accidentally because there was no spec testing for the clients function?

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