Skip to content

Conversation

jasonyuezhang
Copy link
Owner

Deleting a sentry app installation should use async deletions.

The tests for async sentry app deletion cover the below case:

  • Sentry app installations are already collected when we delete the sentry app so we shouldn't need to have extra deletions queued up / done before the task.

https://github.com/getsentry/sentry/blob/e49b651754eaad16f271ce8ddf7e97a457f64cf3/src/sentry/deletions/defaults/sentry_app.py#L14

Required for getsentry#100813


Copied from getsentry#100930
Original PR: getsentry#100930

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

except RequestException as exc:
sentry_sdk.capture_exception(exc)
deletions.exec_sync(sentry_app_installation)
ScheduledDeletion.schedule(sentry_app_installation, days=0, actor=request.user)
Copy link

Choose a reason for hiding this comment

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

Bug: Audit Log Missing Transaction ID

The audit log for Sentry App Installation deletion is created immediately after scheduling the asynchronous deletion, without linking to the ScheduledDeletion object via a transaction_id. This can result in an inconsistent audit trail, as the log may show an uninstalled status even if the deletion later fails.

Fix in Cursor Fix in Web

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.

2 participants