From ffbb6b6f31b66789cd5dacf9def3225879a95621 Mon Sep 17 00:00:00 2001 From: talksik Date: Sun, 8 May 2022 13:33:10 -0500 Subject: [PATCH] fixing the bug with transport closed disconnection --- packages/api/sockets/index.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/api/sockets/index.ts b/packages/api/sockets/index.ts index 78b766f..f050b96 100644 --- a/packages/api/sockets/index.ts +++ b/packages/api/sockets/index.ts @@ -282,10 +282,12 @@ export default function InitializeWs(io: any) { // get fresh list of tuned in folks without me const clientUserIdsInRoom = [ ...(io.sockets.adapter.rooms.get(roomName) ?? []), - ].map( - (otherUserSocketId: string) => - socketIdsToUserIds[otherUserSocketId] - ); + ] + .filter((mappedSocketId) => mappedSocketId !== socket.id) + .map( + (otherUserSocketId: string) => + socketIdsToUserIds[otherUserSocketId] + ); io.in(roomName).emit( ServerResponseChannels.SOMEONE_UNTUNED_FROM_LINE,