Skip to content

fix: make default callback trigger updates atomic#2132

Merged
jolestar merged 1 commit into
mainfrom
fix/default-trigger-transaction
Jul 8, 2026
Merged

fix: make default callback trigger updates atomic#2132
jolestar merged 1 commit into
mainfrom
fix/default-trigger-transaction

Conversation

@jolestar

@jolestar jolestar commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

Verification

  • cargo fmt --all -- --check
  • cargo test http_success_response_shapes_follow_route_class_policy --test http_client -- --nocapture
  • RUSTFLAGS="-D warnings" cargo check --all-targets

@vercel

vercel Bot commented Jul 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
holon Ready Ready Preview, Comment Jul 8, 2026 1:58am

@jolestar

jolestar commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator Author

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 default_external_trigger_record helper. Projection/audit updates correctly remain outside the transaction boundary.

@holonbot holonbot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@holonbot

holonbot Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Holon Run Report

@jolestar
jolestar merged commit 183fad0 into main Jul 8, 2026
6 of 7 checks passed
@jolestar
jolestar deleted the fix/default-trigger-transaction branch July 8, 2026 02:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant