Skip to content

fix(sentry-apps): Deny instead of asserting when an app's organization is gone - #127964

Open
drakeo338 wants to merge 1 commit into
getsentry:masterfrom
drakeo338:fix/sentry-apps-missing-owner-org
Open

drakeo338 wants to merge 1 commit into
getsentry:masterfrom
drakeo338:fix/sentry-apps-missing-owner-org

Conversation

@drakeo338

Copy link
Copy Markdown

Three Sentry App permission classes assert that the app's organization exists, but it can be gone before its tombstone cascades, so the request 500s. They now log and deny, as SentryAppStatsPermission already does.

New tests fail on master and pass here; GET /sentry-apps/{slug}/ returns 403, not 500. Covers item 4 of the issue only.

Refs #127961

Written with AI assistance (Claude Code), reviewed and tested by me.

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

…n is gone

SentryAppPermission, SentryInternalAppTokenPermission and
SentryAppAuthorizationsPermission asserted that the owner or installation
organization exists. SentryApp.owner_id and
SentryAppInstallation.organization_id are cross-silo foreign keys, so the
organization can be deleted before its tombstone removes the app, and a
request in that window failed with a 500.

Log and return False, as SentryAppStatsPermission and
SentryAppWebhookRequestsPermission already do.

Refs getsentry#127961
@drakeo338
drakeo338 requested review from a team as code owners October 19, 2026 04:36
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Oct 19, 2026

This branch has not been deployed

No deployments
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.

1 participant