Skip to content

fix(event): Prevent immediate retry of rate-limited org in event view fallback - #1566

Merged
BYK merged 1 commit into
mainfrom
seer/fix-cli-2y1-event-view-429-retry
Sep 9, 2026
Merged

BYK merged 1 commit into
mainfrom
seer/fix-cli-2y1-event-view-429-retry

Conversation

@sentry

@sentry sentry Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

This PR fixes an issue where the sentry event view command could trigger a "Consecutive HTTP" performance issue (CLI-2Y1).

Root Cause:
When fetchEventWithContext falls back to tryEventFallbacks and resolveEventInOrg hits a 429 (Too Many Requests) rate limit, the error was caught as a generic transient failure. This left sameOrgSearched as false, causing the subsequent findEventAcrossOrgs call to immediately retry the exact same rate-limited endpoint for the same organization. This back-to-back identical request against a rate-limited API endpoint caused the performance issue.

Solution:

  1. Introduce an orgRateLimited flag in tryEventFallbacks.
  2. When resolveEventInOrg catches an ApiError with status 429, set orgRateLimited = true.
  3. Modify the excludeOrgs logic for findEventAcrossOrgs to exclude the organization if sameOrgSearched is true (meaning a definitive not-found) OR if orgRateLimited is true. This prevents futile immediate retries against rate-limited endpoints.
  4. Added a logger.debug call to the catch block to satisfy the no-silent-catch lint rule.

Verification:
Added a unit test to test/commands/event/view.test.ts to specifically cover the 429 rate-limit scenario, ensuring the organization is correctly excluded from the cross-org fallback.

Fixes CLI-2Y1

@sentry <feedback>: Autofix iterates on these changes
@sentry stop iterating: Autofix stops iterating on this run

This PR was automatically generated by Sentry. You can adjust this setting at any time.

@vercel
vercel Bot temporarily deployed to Preview – sentry-local September 9, 2026 10:46 Inactive
@vercel

vercel Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cli Ready Ready Preview Sep 9, 2026 10:47am UTC
1 Skipped Deployment
Project Deployment Actions Updated
sentry-local Skipped Skipped Sep 9, 2026 10:47am UTC

Request Review

@sentry
sentry Bot requested a review from BYK September 9, 2026 17:57
@BYK BYK removed the risk: low label Sep 9, 2026
@BYK
BYK merged commit ec83887 into main Sep 9, 2026
33 checks passed
@BYK
BYK deleted the seer/fix-cli-2y1-event-view-429-retry branch September 9, 2026 18:01

This branch was successfully deployed

1 active and 1 inactive deployments
Preview – cli — e12aa02a Deployed Sep 9, 2026 by vercel[bot]
Preview – sentry-local — e12aa02a Deployed Sep 9, 2026 by vercel[bot]
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.

1 participant