Skip to content

fix(sentry): filter injected ethereum/__firefox__ browser noise - #1164

Merged
kody-bot merged 1 commit into
mainfrom
cursor/sentry-triage-kody-cloudflare-7648833360-c8f2
Aug 3, 2026
Merged

kody-bot merged 1 commit into
mainfrom
cursor/sentry-triage-kody-cloudflare-7648833360-c8f2

Conversation

@kentcdodds

@kentcdodds kentcdodds commented Aug 3, 2026 •

Copy link
Copy Markdown
Owner

Summary

Sentry issue 7648833360 (window.ethereum.selectedAddress) and siblings 7648833403 / 7648833423 (__firefox__) are Brave iOS page global code throws from wallet / Firefox-bridge injected globals — not Kody bundles.

Adds a narrow client beforeSend filter (and matching pre-SDK buffer ignore) for those exact message shapes.

Outcome: filtered — squash-merged; competing #1165/#1166 stood down as subsets.

System recap — composes existing primitives (low risk)

Mode: recap · Base: main @ 802e658a · Head: 6585f652 (merged as 0f7d759)

Classification: composes — extends the existing browser Sentry filter wiring in app-ui only; no new primitives or contracts.

Primitives touched

Primitive Group Impact
app-ui surfaces composes — narrow beforeSend / buffer drop for injected-global noise

System map

Browser Sentry init already runs filterBrowserSentryEvent; this PR adds one more drop predicate for wallet/__firefox__ injection messages.

Legend: green = composes (wiring only) · amber = extended by this PR · red = new primitive · gray = context (unchanged, included only when an edge crosses it).

flowchart LR
	appUi["app-ui<br/>Browser app UI"]:::touched
	appUi -->|"beforeSend + buffer ignore"| appUi
	classDef touched fill:#1a7f37,color:#fff
	classDef extended fill:#9a6700,color:#fff
	classDef added fill:#cf222e,color:#fff
	classDef untouched fill:#57606a,color:#fff
Loading
Open in Web Open in Cursor 

Summary by CodeRabbit

  • Bug Fixes

    • Reduced noisy error reports caused by browser-injected wallet and Firefox bridge scripts.
    • Preserved reporting for genuine application errors and unrelated browser issues.
    • Applied the filtering consistently to captured and buffered client errors.
  • Tests

    • Added coverage for injected browser errors, original exceptions, and unaffected errors.

Drop wallet shim and Firefox-iOS bridge globals (window.ethereum,
window.__firefox__) that throw from page global code on Brave iOS —
not from Kody bundles (issues 7648833360, 7648833403).

Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
@coderabbitai

coderabbitai Bot commented Aug 3, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1df25461-9c7b-4df5-ad1b-3952da022e46

📥 Commits

Reviewing files that changed from the base of the PR and between 802e658 and 6585f65.

📒 Files selected for processing (4)
  • packages/worker/client/sentry-browser-filters.node.test.ts
  • packages/worker/client/sentry-browser-filters.ts
  • packages/worker/client/sentry-client.ts
  • packages/worker/client/sentry-init.ts

📝 Walkthrough

Walkthrough

The Sentry browser filters now identify known wallet and Firefox bridge errors from exceptions and event messages. Browser events and buffered client errors matching these patterns are discarded. Tests cover matching and unrelated errors.

Changes

Browser Sentry noise filtering

Layer / File(s) Summary
Injected global error detection
packages/worker/client/sentry-browser-filters.ts, packages/worker/client/sentry-browser-filters.node.test.ts
The filters match known window.ethereum, window.__firefox__, and missing __firefox__ errors from exceptions or Sentry messages. Tests cover matching and unrelated errors.
Sentry filter pipeline integration
packages/worker/client/sentry-browser-filters.ts, packages/worker/client/sentry-client.ts, packages/worker/client/sentry-init.ts, packages/worker/client/sentry-browser-filters.node.test.ts
The browser and buffered client filters apply the new predicate. The Sentry filtering comment and integration test reflect the added cases.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • kentcdodds/kody#1006: Introduced the Sentry browser-noise filtering pipeline extended by this change.
  • kentcdodds/kody#1166: Added related Firefox window.__firefox__ handling in the same filtering code.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes filtering injected Ethereum and Firefox browser noise in Sentry.
Description check ✅ Passed The description clearly explains the intent and implementation, but it does not include a dedicated Testing section.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/sentry-triage-kody-cloudflare-7648833360-c8f2

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

🔎 Preview deployed: https://kody-pr-1164.kody-a99.workers.dev

Worker: kody-pr-1164
D1: kody-pr-1164-db
KV: kody-pr-1164-oauth-kv

Mocks:

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.

3 participants