fix: resolve peer isolation and invitation link sync issues

This commit is contained in:
Timo
2026-04-22 12:10:26 +02:00
parent 465a34837d
commit 9f004557ed
4 changed files with 35 additions and 4 deletions
+3 -1
View File
@@ -222,8 +222,10 @@ io.on('connection', (socket) => {
if (data.peerId === peerId && sid !== socket.id) {
const oldSocket = io.sockets.sockets.get(sid);
if (oldSocket) {
oldSocket.emit(EVENTS.ERROR, { message: 'Deduplication: Another session with this ID joined. Disconnecting...' });
oldSocket.leave(roomId);
socketToRoom.delete(sid);
oldSocket.disconnect(true);
log('DEDUPE', `Kicked old session for peer ${peerId}`);
}
room.peers.delete(sid);
room.peerIds.delete(sid);