fix(event): Prevent immediate retry of rate-limited org in event view fallback - #1566
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
BYK
marked this pull request as ready for review
September 9, 2026 17:55
BYK
approved these changes
Sep 9, 2026
BYK
approved these changes
Sep 9, 2026
5 tasks
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes an issue where the
sentry event viewcommand could trigger a "Consecutive HTTP" performance issue (CLI-2Y1).Root Cause:
When
fetchEventWithContextfalls back totryEventFallbacksandresolveEventInOrghits a 429 (Too Many Requests) rate limit, the error was caught as a generic transient failure. This leftsameOrgSearchedasfalse, causing the subsequentfindEventAcrossOrgscall 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:
orgRateLimitedflag intryEventFallbacks.resolveEventInOrgcatches anApiErrorwith status 429, setorgRateLimited = true.excludeOrgslogic forfindEventAcrossOrgsto exclude the organization ifsameOrgSearchedis true (meaning a definitive not-found) OR iforgRateLimitedis true. This prevents futile immediate retries against rate-limited endpoints.logger.debugcall to the catch block to satisfy theno-silent-catchlint rule.Verification:
Added a unit test to
test/commands/event/view.test.tsto 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 runThis PR was automatically generated by Sentry. You can adjust this setting at any time.