Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions static/app/constants/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,22 @@ export const IGNORED_SPAN_NAMES = ['amplitude.com', 'pendo.io', 'reload.getsentr
// pollute our breadcrumbs since they may occur a LOT.
//
// XXX(epurkhiser): Note some of these hosts may only apply to sentry.io.
/**
* Deny errors originating from browser extensions. These are third-party
* scripts injected into Sentry pages and are not actionable by us.
* See: https://docs.sentry.io/platforms/javascript/configuration/filtering/#decluttering-sentry
*/
export const IGNORED_ERROR_DENY_URLS = [
// Chrome and generic extension paths (e.g. /extensions/google/setup/)
/extensions\//i,
// Chrome extension protocol
/^chrome-extension:\/\//i,
// Firefox extension protocol
/^moz-extension:\/\//i,
// Safari extension protocol
/^safari-extension:\/\//i,
];

export const SPA_MODE_ALLOW_URLS = [
'localhost',
'dev.getsentry.net',
Expand Down
2 changes: 2 additions & 0 deletions static/app/serviceWorker/worker/initializeSentry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type {Breadcrumb} from '@sentry/browser';

import {
IGNORED_BREADCRUMB_FETCH_HOSTS,
IGNORED_ERROR_DENY_URLS,
IGNORED_SPAN_NAMES,
SENTRY_RELEASE_VERSION,
SPA_DSN,
Expand Down Expand Up @@ -36,6 +37,7 @@ export function initializeSentry({
isInitialized = true;
Sentry.init({
allowUrls: SPA_DSN ? SPA_MODE_ALLOW_URLS : sentryConfig.allowUrls,
denyUrls: IGNORED_ERROR_DENY_URLS,

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.

Filter wired to wrong SDK

Medium Severity

IGNORED_ERROR_DENY_URLS is only passed into the service worker Sentry.init, but the extension TypeError comes from scripts injected into the page and is captured by initializeSdk. The worker also sets defaultIntegrations: false without adding the event/inbound filters integration, so denyUrls does not run there either. The new filter never drops the targeted events.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit bacb7d6. Configure here.

dsn: SPA_DSN || dsn,
release: SENTRY_RELEASE_VERSION ?? sentryConfig.release,
environment: sentryConfig.environment,
Expand Down
Loading