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
Owner

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

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>
josh added 1 commit 2026-03-28 20:43:08 -04:00
fix: capture job baseline before POST to avoid race condition
All checks were successful
CI / test (pull_request) Successful in 14s
CI / build-dev (pull_request) Has been skipped
1bbe743dba
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>
josh scheduled this pull request to auto merge when all checks succeed 2026-03-28 20:43:13 -04:00
josh merged commit e2935c58c8 into dev 2026-03-28 20:43:26 -04:00
josh deleted branch feat/jobs-system 2026-03-28 20:43:26 -04:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: josh/Catalyst#60