3 Commits

Author SHA1 Message Date
cb83d11261 Merge pull request 'fix: config is already a parsed object from the jobs API response' (#61) from feat/jobs-system into dev
All checks were successful
CI / test (push) Successful in 14s
CI / build-dev (push) Successful in 26s
Reviewed-on: #61
2026-03-28 20:47:46 -04:00
047fd0653e Merge branch 'dev' into feat/jobs-system
All checks were successful
CI / test (pull_request) Successful in 13s
CI / build-dev (pull_request) Has been skipped
2026-03-28 20:47:18 -04:00
027ed52768 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>
2026-03-28 20:46:49 -04:00

View File

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