fix: capture job baseline before POST to avoid race condition #60

Merged
josh merged 1 commits from feat/jobs-system into dev 2026-03-28 20:43:26 -04:00
1 Commits
Author SHA1 Message Date
joshandClaude Sonnet 4.6 1bbe743dba fix: capture job baseline before POST to avoid race condition
CI / build-dev (pull_request) Has been skipped
CI / test (pull_request) Successful in 14s
The previous version snapshotted last_run_id after the 201 response,
but jobs fire immediately server-side — by the time the client fetched
/api/jobs the runs were already complete, so the baseline matched the
new state and the poll loop never detected completion.

Baseline is now captured before the creation POST so it always
reflects pre-run state regardless of job speed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-28 20:42:46 -04:00