fix(sentry): match ignore patterns per-field in shouldIgnoreError#2450
Open
innolope-dev wants to merge 3 commits into
Open
fix(sentry): match ignore patterns per-field in shouldIgnoreError#2450innolope-dev wants to merge 3 commits into
innolope-dev wants to merge 3 commits into
Conversation
Capacitor plugin calls executing inside the /crisp-proxy iframe on native throw '"<Plugin>" plugin is not implemented on ios' because the bridge is not injected into iframes. Pure noise, not a broken binary (PEANUT-UI-QV3: 2,211 events in 14 days from 6 users). Filter the whole message family (StatusBar, Keyboard, App, ...) in shouldIgnoreError via a regex pattern, and add unit coverage for the ignore rules.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📝 WalkthroughWalkthroughChangesSentry noise filtering
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Contributor
Code-analysis diffPainscore total: 6208.86 → 6208.86 (0) |
Contributor
🧪 UI test report — ✅ all greenSuites
📊 Coverage (unit)
⏱ 10 slowest test cases
|
Contributor
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@sentry.utils.ts`:
- Around line 70-71: Update the matching logic around the searchText
construction and pattern check so each independent Sentry field is evaluated
separately, rather than searching a combined string that can create cross-field
matches. Apply regex patterns to each field’s original text without lowercasing,
while retaining case-insensitive handling for string patterns; add a regression
test covering a match split between event.message and an exception value.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 4ce20a7a-f0df-4770-900e-d55155dd2ee4
📒 Files selected for processing (2)
sentry.utils.tssrc/utils/__tests__/sentry-ignore.test.ts
… fields Matching against one concatenated blob of message + exception value/type + culprit let a pattern match across field boundaries and suppress an unrelated event. Test each field independently; regexes now also run against the original (non-lowercased) text with their own flags.
The /crisp-proxy iframe source of the plugin-not-implemented events was already fixed (972f354); residual events come from stale binaries, and a message filter would permanently mask a top-frame plugin failure on a fresh binary — a genuinely broken build we want reported. The Sentry issue is resolved in the dashboard instead (reopens as regressed if it recurs). Keep the per-field matching in shouldIgnoreError: the old concatenated blob let a pattern match across unrelated fields and suppress legitimate events. Tests now cover per-field matching, the cross-boundary case, and the previously untested ignore list.
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.
Problem
shouldIgnoreErrorinsentry.utils.tsmatched ignore patterns against one concatenated blob of independent event fields (message+ exception value + exception type + culprit). A pattern could therefore match across a field boundary — e.g. a message ending in... Userplus an exception value starting withrejected ...would hit the'User rejected'pattern and silently suppress an unrelated, legitimate error. The ignore list also had zero test coverage.Fix
Note on PEANUT-UI-QV3 (
"StatusBar" plugin is not implemented on ios), which this PR originally filtered: per the rationale accepted in #2448, the/crisp-proxyiframe source was already fixed in 972f354 and the residual 2,211 events (6 users, last seen 6 days ago) come from stale binaries. A message-regex filter would permanently mask a top-frame "plugin not implemented" on a fresh binary — a genuinely broken native build we'd want paged on. So no new filter is added; QV3 is resolved in the Sentry dashboard instead, which is reversible (it reopens flagged as regressed if it recurs).Impact
Testing
src/utils/__tests__/sentry-ignore.test.tsfor the previously untestedshouldIgnoreError: per-field matching inmessageand exception values, case-insensitivity, the cross-boundary regression case (a pattern split across two fields must NOT match), unrelated errors still reported, and extension-stack-frame filtering intact.pnpm jest src/utils/__tests__/sentry-ignore.test.ts src/utils/__tests__/sentry.utils.test.ts— 27/27 pass.pnpm typecheck— clean.pnpm prettier --checkon touched files — clean.