Skip to content

Conversation

@sentry
Copy link
Contributor

@sentry sentry bot commented Jan 26, 2026

Previously, IdentityNotValid exceptions, which occur when OAuth refresh tokens become invalid (e.g., due to user revocation, password change, or expiration), were being recorded as failures in the IntegrationEventLifecycle. This led to a significant volume of unnecessary Sentry issues (over 500,000 events) and skewed integration SLO metrics, as these are expected behaviors in the OAuth lifecycle rather than system bugs.

This change modifies the IntegrationEventLifecycle to treat IdentityNotValid exceptions as halts instead of failures. This aligns with how RestrictedIPAddress exceptions are handled, reducing noise in Sentry and improving the accuracy of our integration metrics.

Changes Made:

  • Imported IdentityNotValid from sentry.auth.exceptions.
  • Modified IntegrationEventLifecycle.__exit__ to check for IdentityNotValid and call record_halt() when encountered.
  • Updated IntegrationProxyEvent.capture() to return IntegrationEventLifecycle to ensure that integration proxy events benefit from this updated exception handling.

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.

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jan 26, 2026
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

0 participants