From 954c0c4c39ed3c82d915967e0997d0ef66752cec Mon Sep 17 00:00:00 2001 From: "seer-by-sentry[bot]" <157164994+seer-by-sentry[bot]@users.noreply.github.com> Date: Fri, 16 Jan 2026 12:03:19 +0000 Subject: [PATCH 1/2] fix: Enhance Sentry error suppression for third-party ad scripts --- src/router.tsx | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/src/router.tsx b/src/router.tsx index 56988a9c..6ccb3c40 100644 --- a/src/router.tsx +++ b/src/router.tsx @@ -58,6 +58,53 @@ export function getRouter() { // Session Replay replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production. replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur. + // Filter out third-party ad script errors (Publift Fuse and NoBid) + beforeSend(event, hint) { + const error = hint.originalException + + // Check if error is from third-party ad scripts + const isAdScriptError = event.exception?.values?.some((exception) => { + const frames = exception.stacktrace?.frames || [] + + // Check if any frame in the stack trace is from ad scripts + const hasAdScriptFrame = frames.some((frame) => { + const filename = frame.filename || '' + return ( + filename.includes('/media/native/') || + filename.includes('fuse.js') || + filename.includes('fuseplatform.net') || + filename.includes('/nobid/blocking_script.js') + ) + }) + + // Check if error message matches known patterns + const errorMessage = exception.value || '' + const hasKnownErrorPattern = + errorMessage.includes('contextWindow.parent') || + errorMessage.includes('null is not an object') || + errorMessage.includes('is not a function') + + return hasAdScriptFrame && hasKnownErrorPattern + }) + + // Also check the error object directly if available + const isAdScriptErrorFromHint = + error && + typeof error === 'object' && + 'message' in error && + typeof error.message === 'string' && + (error.message.includes('contextWindow.parent') || + error.message.includes('null is not an object') || + error.message.includes('is not a function')) + + // Drop the event if it's from ad scripts + if (isAdScriptError || isAdScriptErrorFromHint) { + console.debug('Filtered out ad script error from Sentry:', event) + return null + } + + return event + }, }) } From ffb889dd54ce2023e407ee91443b95b4a9913304 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Fri, 16 Jan 2026 12:04:11 +0000 Subject: [PATCH 2/2] ci: apply automated fixes --- src/router.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/router.tsx b/src/router.tsx index 6ccb3c40..c8c66584 100644 --- a/src/router.tsx +++ b/src/router.tsx @@ -61,11 +61,11 @@ export function getRouter() { // Filter out third-party ad script errors (Publift Fuse and NoBid) beforeSend(event, hint) { const error = hint.originalException - + // Check if error is from third-party ad scripts const isAdScriptError = event.exception?.values?.some((exception) => { const frames = exception.stacktrace?.frames || [] - + // Check if any frame in the stack trace is from ad scripts const hasAdScriptFrame = frames.some((frame) => { const filename = frame.filename || '' @@ -76,17 +76,17 @@ export function getRouter() { filename.includes('/nobid/blocking_script.js') ) }) - + // Check if error message matches known patterns const errorMessage = exception.value || '' const hasKnownErrorPattern = errorMessage.includes('contextWindow.parent') || errorMessage.includes('null is not an object') || errorMessage.includes('is not a function') - + return hasAdScriptFrame && hasKnownErrorPattern }) - + // Also check the error object directly if available const isAdScriptErrorFromHint = error && @@ -96,13 +96,13 @@ export function getRouter() { (error.message.includes('contextWindow.parent') || error.message.includes('null is not an object') || error.message.includes('is not a function')) - + // Drop the event if it's from ad scripts if (isAdScriptError || isAdScriptErrorFromHint) { console.debug('Filtered out ad script error from Sentry:', event) return null } - + return event }, })