Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

90
Views
socket joined the room but doesn't receive events in room

Socket joins a room on connection, the room name can be found on rooms set defined on socket itself, but when an event is fired to that room, it doesn't receive that. Can someone figure out the issue with my code?

Joining

    this.socketIOServer.on('connect', async (socket: AuthenticatedSocket) => {
      if (socket?.request?.user?.id) {
        await socket.join(socket.request.user.id);
        console.log(socket.rooms); // Set(2) { 'j462VueHBUxufBucAAAB', '62c16b98be39c3605f03fd5a' }
      }
    });

Emitting


    console.log(
      'Sockets',
      AppointmentsSocketService.server.sockets.sockets.forEach(s => {
        console.log(s.rooms); // Set(2) { 'j462VueHBUxufBucAAAB', '62c16b98be39c3605f03fd5a' } Found in output
      }),
    );

    /* EMIT EVENT TO ROOM */
    AppointmentsSocketService.server
      .to(appointment.patient.id) // id is exactly as room name '62c16b98be39c3605f03fd5a'
      .emit('appointments/status', appointment);

    console.log(
      'Sockets',
      AppointmentsSocketService.server.sockets.sockets.forEach(s => {
        console.log(s.rooms); // Set(2) { 'j462VueHBUxufBucAAAB', '62c16b98be39c3605f03fd5a' } Found in output
      }),
    );

I'm testing through postman, & that never receives the response. I also try using Firecamp app as well as wrote dummy script to test - but never received event.

Postman Screenshot

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!