From ada3b31ad1545eb9891aa7d081def39450df18e5 Mon Sep 17 00:00:00 2001 From: Administrator Date: Sat, 21 Mar 2026 14:16:59 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20health=20check=20wait=20t?= =?UTF-8?q?imeout,=20=5FdeletedJobIds=20memory=20cleanup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add 30-second timeout to health check wait loop in startUpload/ startSelectedUpload to prevent infinite spin if healthCheckRunning gets stuck - Clear _deletedJobIds Set when batch completes to prevent unbounded memory growth over long sessions with many deletions Co-Authored-By: Claude Opus 4.6 (1M context) --- renderer/app.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/renderer/app.js b/renderer/app.js index 4e2ade4..358b3ba 100644 --- a/renderer/app.js +++ b/renderer/app.js @@ -1315,7 +1315,7 @@ function getSelectedJobLinks() { async function startUpload() { if (uploading) return; // Wait for any running health check to finish (e.g. startup auto-check) - while (healthCheckRunning) await new Promise(r => setTimeout(r, 100)); + for (let _hcWait = 0; healthCheckRunning && _hcWait < 300; _hcWait++) await new Promise(r => setTimeout(r, 100)); // max 30s uploading = true; // set immediately to prevent double-click race updateQueueActionButtons(); @@ -1386,7 +1386,7 @@ async function startUpload() { async function startSelectedUpload() { if (uploading) return; - while (healthCheckRunning) await new Promise(r => setTimeout(r, 100)); + for (let _hcWait = 0; healthCheckRunning && _hcWait < 300; _hcWait++) await new Promise(r => setTimeout(r, 100)); // max 30s uploading = true; // set immediately to prevent double-click race updateQueueActionButtons(); @@ -1567,6 +1567,7 @@ function handleProgress(data) { function handleBatchDone(summary) { uploading = false; applySummaryResults(summary); + _deletedJobIds.clear(); // Free memory — stale IDs no longer needed after batch completes // Reset aborted jobs back to queued so they can be restarted for (const job of queueJobs) {