fix: make default callback trigger updates atomic#2132
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Review: LGTM. Atomicity fix is correct — wrapping the read-modify-write cycle for default external triggers in a single DB transaction eliminates the race condition where concurrent calls could create duplicates or miss revocations. Good DRY with |
There was a problem hiding this comment.
Clean atomicity fix — wrapping the read-modify-write cycle for default external triggers in a single DB transaction correctly eliminates the race condition. Good DRY with default_external_trigger_record helper and transaction-scoped active_default_for_agent_tx. Projection/audit updates correctly remain outside the transaction boundary.
One minor nit: the ensure_default_for_agent path doesn't emit an external_trigger_revoked audit event when revoking a token-less record (the reset_callback path does). This is preserved behavior, not a regression — just an observability consistency opportunity.
Holon Run Report
|
Summary
Verification