Repository navigation
fix(investigations): restart only from the status it read - #2321
Conversation
A resolve that lands between the restart's read and its update now returns the 409 instead of being overwritten.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 22 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Maple review🟢 Confidence 10/10 · safe to merge. A two-line guard on
|
Follow-up to #2310, addressing this CodeRabbit finding: #2310 (review)
restartInvestigationguarded its UPDATE on any restartable status, not the one it read. A resolve landing between the read and the update was silently overwritten. The UPDATE now also requiresstatus = existing.status(the unclaimedinvestigatingguard stays), so the race returns the existingInvestigationTransitionError409 ("changed while restarting").New PGlite test wraps
Databaseto run a resolve right after the restart's read, then asserts the 409, the row stillresolved, and no turn sent.Without the fix the test fails (the restart succeeds and the row is back to
investigating):With the fix:
packages/backendtypecheck andoxlint -c .oxlintrc.effect.jsonon both files are clean.🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.