Repository navigation
fix(client): filter Fathom removeChild-on-null Sentry noise (KODY-CLOUDFLARE-3Q) - #1232
Conversation
Drop browser events for KODY-CLOUDFLARE-3Q where Fathom's beacon img handler calls parentNode.removeChild after the node was already detached. Match requires both the Chromium removeChild-null TypeError text and a cdn.usefathom.com stack frame so app removeChild bugs still report. Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughChangesThe browser Sentry filters now inspect nested exception stack frames for URLs. They discard the exact null- Fathom Sentry filtering
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
|
🔎 Preview deployed: https://kody-pr-1232.kody-a99.workers.dev Worker: Mocks:
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@packages/worker/client/sentry-browser-filters.ts`:
- Around line 221-229: Update isFathomAnalyticsStackFrameUrl to parse the input
URL and return true only when its hostname equals cdn.usefathom.com, rather than
matching a URL substring; preserve safe handling for invalid URLs. Add a
regression case covering a non-Fathom hostname using /cdn.usefathom.com/ in its
path.
In `@packages/worker/client/sentry-init.ts`:
- Around line 32-36: Update the issue identifier in the Sentry filter comment
near filterBrowserSentryEvent from KODY-CLOUDFLARE-23 to KODY-CLOUDFLARE-3Q,
leaving the surrounding references unchanged.
🪄 Autofix
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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: c5c5ec58-91b5-4f22-bba0-94e71622ffb8
📒 Files selected for processing (3)
packages/worker/client/sentry-browser-filters.node.test.tspackages/worker/client/sentry-browser-filters.tspackages/worker/client/sentry-init.ts
Parse frame URLs and compare hostname to cdn.usefathom.com so a path-substring lookalike on heykody.dev cannot false-positive the drop. Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Summary
Filters browser Sentry noise from KODY-CLOUDFLARE-3Q (
7653117289).Fathom Analytics (
cdn.usefathom.com/script.js) inserts a temporary<img>beacon and removes it inload/errorhandlers viaimg.parentNode.removeChild(img). After SPA navigation the beacon can already be detached, soparentNodeis null and Chromium throws:TypeError: Cannot read properties of null (reading 'removeChild')Sentry's
browserapierrors.addEventListenerwrapper captures that third-party throw. Not a Kody product bug and not reasonably fixable in app code (external script).Change
filterFathomRemoveChildNullSentryEventinsentry-browser-filters.tscdn.usefathom.com(so real appremoveChildbugs still report)filterBrowserSentryEvent; unit tests cover drop / keep / hostname lookalike casesOutcome
filtered — ship this filter, then ignore the Sentry issue so it stops paging.
No sibling unresolved issues share this Fathom / removeChild signature.
System recap — composes existing primitives (low risk)
Mode: recap · Base:
main@bd33593e· Head:2888b905Classification: composes — narrow browser
beforeSendfilter on the existing client Sentry path; no new primitives or contracts.Primitives touched
app-uiSystem map
Browser errors still flow through the existing client Sentry init; this PR only drops one third-party Fathom signature in
beforeSend.Legend: green = composes (wiring only) · amber = extended by this PR · red = new primitive · gray = context (unchanged, included only when an edge crosses it).
Summary by CodeRabbit
removeChilderror.