From 3ec10a52e4036332fc0979a1e00f79a17191924e Mon Sep 17 00:00:00 2001 From: Timo <6156589+Shik3i@users.noreply.github.com> Date: Wed, 22 Apr 2026 09:53:26 +0200 Subject: [PATCH] Refactor: Comprehensive Security and Architecture Audit (Self-Audit Fixes) --- extension/content.js | 4 ++++ server/index.js | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/extension/content.js b/extension/content.js index a06aa7b..e987282 100644 --- a/extension/content.js +++ b/extension/content.js @@ -101,13 +101,17 @@ } else if (action === 'seek') { tryMediaAction('seek', payload); } else if (action === 'force_sync_prepare') { + isProcessingCommand = true; const video = findVideo(); if (video) { video.pause(); video.currentTime = payload.targetTime; pollSeekReady(payload.targetTime).then(() => { chrome.runtime.sendMessage({ type: 'FORCE_SYNC_ACK' }); + setTimeout(() => { isProcessingCommand = false; }, 1000); }); + } else { + isProcessingCommand = false; } } else if (action === 'force_sync_execute') { tryMediaAction('play'); diff --git a/server/index.js b/server/index.js index 1c4ffe5..ba70d36 100644 --- a/server/index.js +++ b/server/index.js @@ -137,8 +137,9 @@ io.on('connection', (socket) => { log('CONN', `New connection: ${socket.id} from ${clientIp}`); - socket.on(EVENTS.JOIN_ROOM, async ({ roomId, password, peerId, protocolVersion }) => { - if (typeof roomId !== 'string') return; + socket.on(EVENTS.JOIN_ROOM, async (payload) => { + if (!payload || typeof payload.roomId !== 'string') return; + const { roomId, password, peerId, protocolVersion } = payload; try { // Protocol check if (protocolVersion !== '1.0.0') {