From 73887318b28fc4bde7c9bb2fd855bfaa350910b6 Mon Sep 17 00:00:00 2001 From: Matthew Jackson Date: Fri, 6 Mar 2026 19:50:27 -0800 Subject: [PATCH] Fix saveQueue() called without argument in job_filter.mjs Iterate over the full queue array instead of getJobsByStatus() results, and pass it to saveQueue(). The previous code passed no argument, which would corrupt or silently fail the save. Co-Authored-By: Claude Opus 4.6 --- job_filter.mjs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/job_filter.mjs b/job_filter.mjs index a10919b..e84bd17 100644 --- a/job_filter.mjs +++ b/job_filter.mjs @@ -212,15 +212,16 @@ async function submit(settings, searchConfig, candidateProfile) { const stateExists = existsSync(resolve(__dir, 'data/filter_state.json')); if (!stateExists) { let cleared = 0; - for (const j of getJobsByStatus('new')) { - if (j.filter_score == null && j.filter_batch_id) { + const queue = loadQueue(); + for (const j of queue) { + if (j.status === 'new' && j.filter_score == null && j.filter_batch_id) { delete j.filter_batch_id; delete j.filter_submitted_at; cleared++; } } if (cleared > 0) { - saveQueue(); + saveQueue(queue); console.log(`🔄 Cleared ${cleared} stale batch markers (batch completed without scoring)`); } }