fix: config is already a parsed object from the jobs API response
All checks were successful
CI / test (pull_request) Successful in 14s
CI / build-dev (pull_request) Has been skipped

maskJob parses job.config before returning it, so calling JSON.parse
on it again threw an exception. The catch returned false for every
job, so relevant was always empty and _waitForOnCreateJobs returned
immediately without polling.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-28 20:46:49 -04:00
parent 1bbe743dba
commit 027ed52768

View File

@@ -318,9 +318,7 @@ async function _snapshotJobBaseline() {
async function _waitForOnCreateJobs(baseline) {
const jobs = await fetch('/api/jobs').then(r => r.json());
const relevant = jobs.filter(j => {
try { return JSON.parse(j.config || '{}').run_on_create; } catch { return false; }
});
const relevant = jobs.filter(j => (j.config ?? {}).run_on_create);
if (!relevant.length) return;
const deadline = Date.now() + 30_000;