fix(event-view): add cross-org fallback when event not found#744
Conversation
When a user specifies the wrong org (e.g., `sentry event view wrong-org/cli/<id>`), the event lookup now searches across all accessible organizations as a last resort, instead of only searching within the specified org. Fallback chain: project-scoped fetch → same-org eventids → cross-org fan-out. Warns the user when the event is found in a different org/project. Also adds `excludeOrgs` option to `findEventAcrossOrgs` to skip the org already searched, avoiding a redundant API call.
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Bug Fixes 🐛Init
Resolve
Upgrade
Other
Internal Changes 🔧
🤖 This preview updates automatically when you update the PR. |
|
Codecov Results 📊✅ 134 passed | Total: 134 | Pass Rate: 100% | Execution Time: 0ms 📊 Comparison with Base Branch
✨ No test changes detected All tests are passing successfully. ✅ Patch coverage is 100.00%. Project has 1628 uncovered lines. Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 95.29% 95.30% +0.01%
==========================================
Files 234 234 —
Lines 34606 34646 +40
Branches 0 0 —
==========================================
+ Hits 32977 33018 +41
- Misses 1629 1628 -1
- Partials 0 0 —Generated by Codecov Action |
…gation - Only exclude the org from cross-org search when same-org search completed successfully (returned null). Transient errors (500, timeout) no longer prevent the cross-org fallback from retrying that org. - Re-throw AuthError from cross-org fallback instead of swallowing it, matching the behavior in findEventAcrossOrgs and resolveAutoDetectTarget.
Same-org catch block now also re-throws AuthError, consistent with the cross-org catch block. Prevents masking auth problems behind misleading "event not found" errors.
There was a problem hiding this comment.
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.
Reviewed by Cursor Bugbot for commit 07c0a34. Configure here.

Summary
Fixes #734 —
sentry event viewnow finds events even when the user specifies the wrong organization.fetchEventWithContext: after project-scoped and same-org lookups both return 404, fans out to all accessible orgs viafindEventAcrossOrgsexcludeOrgsoption tofindEventAcrossOrgsto skip the already-searched orgtryEventFallbacks()helper to stay under Biome's complexity limitFallback chain (updated)
getEvent(org, project, eventId)— project-scopedresolveEventInOrg(org, eventId)— same-org, cross-projectfindEventAcrossOrgs(eventId, { excludeOrgs: [org] })— all accessible orgsResolutionErrorwith suggestionsTest plan
excludeOrgspassthrough, error swallowing, and cascading from same-org errors