Skip to content

fix(error-reporting): silence ResolutionError to prevent crash reports#1115

Open
sentry[bot] wants to merge 3 commits into
mainfrom
seer/fix/silence-resolution-error
Open

fix(error-reporting): silence ResolutionError to prevent crash reports#1115
sentry[bot] wants to merge 3 commits into
mainfrom
seer/fix/silence-resolution-error

Conversation

@sentry

@sentry sentry Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

The ResolutionError is thrown when a user provides an event ID that cannot be found, which is an expected user input error. Currently, these errors are not explicitly silenced in src/lib/error-reporting.ts, leading to them being reported to Sentry as unhandled crash reports. This fix updates the classifySilenced function to recognize ResolutionError and classify it as a user_input_error, preventing these expected errors from generating unnecessary Sentry issues.

Fixes CLI-RP

@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://cli.sentry.dev/_preview/pr-1115/

Built to branch gh-pages at 2026-06-23 22:34 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@BYK BYK left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want to keep these as users don't randomly type bogus event ids.

@MathurAditya724 MathurAditya724 added the jared Trigger the Jared agent to work on stuff label Jun 22, 2026

@jared-outpost jared-outpost Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI is failing because the tests weren't updated to match the new behavior. Two test failures:

  1. classifySilenced > does NOT silence ResolutionError (line 250) — the test.each block explicitly asserts classifySilenced(new ResolutionError(...)) returns null. Need to move ResolutionError out of that block and add a dedicated test asserting it returns "user_input_error".

  2. reportCliError integration > captures ResolutionError (line 450) — asserts captureException is called for ResolutionError, but silenced errors skip capture. This test should instead assert captureException is NOT called and the silenced metric IS emitted with reason "user_input_error".

Also, the module-level JSDoc (line 6) lists only OutputError, AuthError, and ApiError as silenced — should mention ResolutionError now too.

@MathurAditya724

Copy link
Copy Markdown
Member

@jared-outpost fix all these issues

Comment thread src/lib/error-reporting.ts Outdated
@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Codecov Results 📊

✅ Patch coverage is 100.00%. Project has 5048 uncovered lines.
✅ Project coverage is 81.36%. Comparing base (base) to head (head).

Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    81.35%    81.36%    +0.01%
==========================================
  Files          392       392         —
  Lines        27070     27075        +5
  Branches     17566     17575        +9
==========================================
+ Hits         22019     22027        +8
- Misses        5051      5048        -3
- Partials      1832      1830        -2

Generated by Codecov Action

@MathurAditya724 MathurAditya724 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed this after the test/docs update. I agree with the existing maintainer objection, and this still should not merge as-is.

Blocking finding:

  • src/lib/error-reporting.ts:61-63 silences every ResolutionError unconditionally. That is too broad and directly contradicts the earlier review: these are not all random user typos. ResolutionError is used for event, issue, replay, log, and trace lookup failures that we still want to capture for product/CLI observability.

Additional impact:

  • src/lib/telemetry.ts:233-238 uses classifySilenced to decide whether to mark the session crashed. After this PR, every ResolutionError stops producing a Sentry error and also stops counting as a crashed session. That release-health behavior change is broader than the PR description and is not justified here.
  • The existing ResolutionError grouping/context logic in src/lib/error-reporting.ts becomes mostly dead for normal command errors, and the replacement cli.error.silenced metric only records error_class=ResolutionError plus a generic reason, losing resource/detail context.

If there are specific expected resolution failures that should be silenced, the class needs a narrower signal or subtype/reason. Silencing the entire class is conceptually wrong.

Silencing the entire ResolutionError class was too broad — it suppressed
project/issue/replay/log/trace lookup failures that we still want captured
for observability, and stopped them counting as crashed sessions.

Add an opt-in `expected` flag (default false) and only silence instances
that set it. Mark the event-not-found sites in event/view.ts as expected
(the originally intended case). Preserve resource_kind on the silenced
metric so sub-grouping context isn't lost.
@github-actions github-actions Bot added the risk: high PR risk score: high label Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jared Trigger the Jared agent to work on stuff risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants