Skip to content

feat(GAL): Add idempotency key to publish functions#119534

Merged
thetruecpaul merged 1 commit into
masterfrom
cpaul/act2act/idempotent_publish
Jul 13, 2026
Merged

feat(GAL): Add idempotency key to publish functions#119534
thetruecpaul merged 1 commit into
masterfrom
cpaul/act2act/idempotent_publish

Conversation

@thetruecpaul

Copy link
Copy Markdown
Contributor

Intended to help prevent collisions on activity double-write and activity backfill (but may be useful overall!)

@thetruecpaul thetruecpaul requested a review from kcons July 13, 2026 17:25
@thetruecpaul thetruecpaul force-pushed the cpaul/act2act/idempotent_publish branch from c44d404 to f291887 Compare July 13, 2026 17:27
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Jul 13, 2026
Comment thread src/sentry/issues/action_log/publish.py Outdated
@thetruecpaul thetruecpaul force-pushed the cpaul/act2act/idempotent_publish branch from f291887 to c0175fc Compare July 13, 2026 17:33
Comment thread src/sentry/issues/action_log/types.py Outdated
@thetruecpaul thetruecpaul force-pushed the cpaul/act2act/idempotent_publish branch from c0175fc to 9f3c7f0 Compare July 13, 2026 17:43
@thetruecpaul thetruecpaul marked this pull request as ready for review July 13, 2026 18:04
@thetruecpaul thetruecpaul requested review from a team as code owners July 13, 2026 18:04
Comment thread src/sentry/receivers/outbox/cell.py Outdated
Comment thread src/sentry/receivers/outbox/cell.py Outdated
Comment thread src/sentry/issues/action_log/publish.py Outdated
Comment thread src/sentry/receivers/outbox/cell.py Outdated
actor_id=payload["actor_id"],
source=payload["source"],
data=payload["data"],
idempotency_key=payload.get("idempotency_key"),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yeah, we need the dup handling here.

Comment thread src/sentry/issues/action_log/publish.py Outdated
@thetruecpaul thetruecpaul force-pushed the cpaul/act2act/idempotent_publish branch from 9f3c7f0 to cfe21de Compare July 13, 2026 18:27

@yuvmen yuvmen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

looks good! just need to address the error handling like the bot mentioned I believe

Edit: see you just addressed it, nice

@cursor cursor 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.

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit cfe21de. Configure here.

Comment thread src/sentry/receivers/outbox/cell.py
)
except IntegrityError:
# Idempotency conflict; we treat this as a no-op.
pass

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.

Duplicate key still triggers processing

Medium Severity

After an idempotency IntegrityError, the handler still registers transaction.on_commit to run trigger_group_log_processing. A collision is meant to be a no-op for the publish path, but this schedules derived work (inline or async) even when no new log entry was written.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit cfe21de. Configure here.

Comment thread tests/sentry/issues/test_action_log.py
Comment thread src/sentry/receivers/outbox/cell.py Outdated
@thetruecpaul thetruecpaul force-pushed the cpaul/act2act/idempotent_publish branch from cfe21de to aab5246 Compare July 13, 2026 19:57
Intended to help prevent collisions on activity double-write and activity backfill (but may be useful overall!)
@thetruecpaul thetruecpaul force-pushed the cpaul/act2act/idempotent_publish branch from aab5246 to c331b4d Compare July 13, 2026 20:24
@thetruecpaul thetruecpaul enabled auto-merge (squash) July 13, 2026 20:40
@thetruecpaul thetruecpaul merged commit ee593bb into master Jul 13, 2026
86 checks passed
@thetruecpaul thetruecpaul deleted the cpaul/act2act/idempotent_publish branch July 13, 2026 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants