Fix memory leak and unhandled promise rejection in service worker

This commit is contained in:
Timo
2026-04-22 10:49:35 +02:00
parent 643c70772e
commit 15afcccd0a
2 changed files with 3 additions and 0 deletions
+2
View File
@@ -431,6 +431,8 @@ async function routeToContent(action, payload) {
files: ['content.js']
}).then(() => {
setTimeout(() => routeToContent(action, payload), 500);
}).catch(err => {
addLog(`Auto-reinject failed for tab ${tabId}`, 'warn');
});
} else {
addLog(`Content Script not responding in tab ${tabId}`, 'warn');
+1
View File
@@ -174,6 +174,7 @@ io.on('connection', (socket) => {
if (oldRoom) {
oldRoom.peers.delete(socket.id);
oldRoom.peerIds.delete(socket.id);
oldRoom.peerData.delete(socket.id);
socket.to(oldMapping.roomId).emit(EVENTS.PEER_STATUS, { peerId: oldMapping.peerId, status: 'left' });
if (oldRoom.peers.size === 0) rooms.delete(oldMapping.roomId);
}