Skip to content

Conversation

@cathteng
Copy link
Member

@cathteng cathteng commented Jan 30, 2026

Sentry app and install outboxes for deletion are currently flushed synchronously, they should be async to prevent db contention when the deletion outboxes are processed.

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jan 30, 2026
@cathteng cathteng marked this pull request as ready for review January 30, 2026 21:47
@cathteng cathteng requested review from a team as code owners January 30, 2026 21:47
@cathteng
Copy link
Member Author

There's a test failing that I'm not sure what the fix is yet

Copy link
Contributor

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.


@control_silo_model
class SentryApp(ParanoidModel, HasApiScopes, Model):
default_flush = False
Copy link
Contributor

Choose a reason for hiding this comment

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

default_flush attribute on SentryApp is unused

Low Severity

The default_flush = False attribute on SentryApp class is dead code. Unlike SentryAppInstallation which inherits from ReplicatedControlModel (which uses self.default_flush), SentryApp inherits from ParanoidModel, HasApiScopes, Model - none of which reference this attribute. Additionally, SentryApp has explicit implementations of save(), update(), and delete() that call outbox_context(..., flush=False) directly without ever reading self.default_flush. The attribute provides no functionality and may mislead developers into thinking it affects behavior.

Fix in Cursor Fix in Web

def delete(self, *args, **kwargs):
with outbox_context(transaction.atomic(using=router.db_for_write(SentryAppInstallation))):
with outbox_context(
transaction.atomic(using=router.db_for_write(SentryAppInstallation)), flush=False
Copy link
Member

Choose a reason for hiding this comment

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

If default_flush=False do we also need flush=False here? You could reference self.default_flush here if you wanted to be explicit 🤷

Copy link
Member Author

Choose a reason for hiding this comment

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

I guess I was doing this because the update and save functions in this model also do it, but we can change it

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.

2 participants