docs(server): record why the review-participant recovery insert leaves responsibleUserId null

Add a comment above the heartbeat_runs insert in
queueReviewParticipantRecoveryRun. It states that claimQueuedRun and
initializeRunIdentity set the value later, that no code reads it on a
queued row, and that resolving it here would add a throw inside the
release transaction that runs the review-recovery path.

Co-authored-by: Paperclip <noreply@paperclip.ing>
This commit is contained in:
nickyleach 2026-09-10 07:43:33 +00:00
parent 0bff1d5cb6
commit 0b81bda287
1 changed files with 7 additions and 0 deletions

View File

@ -453,6 +453,13 @@ function buildTransaction(tx: Db, deps: WakeQueuePostgresAdapterDeps): WakeQueue
.returning()
.then((rows) => rows[0]);
// This insert does not set responsibleUserId. claimQueuedRun resolves the
// responsible user and writes it in the same update that moves the run
// from "queued" to "running", and initializeRunIdentity then overwrites
// it again from the run identity chain. No code reads responsibleUserId
// on a queued row. Resolving the responsible user here, like the other
// recovery writers do, would add a throw inside this release transaction
// — on the one path whose job is to un-stick a stalled review.
const queuedRun = await tx
.insert(heartbeatRuns)
.values({