diff --git a/packages/core/src/integrations/inboundfilters.ts b/packages/core/src/integrations/inboundfilters.ts index 9d9f803a69f5..6234f92e499d 100644 --- a/packages/core/src/integrations/inboundfilters.ts +++ b/packages/core/src/integrations/inboundfilters.ts @@ -13,11 +13,13 @@ const DEFAULT_IGNORE_ERRORS = [ /^Javascript error: Script error\.? on line 0$/, /^ResizeObserver loop completed with undelivered notifications.$/, // The browser logs this when a ResizeObserver handler takes a bit longer. Usually this is not an actual issue though. It indicates slowness. /^Cannot redefine property: googletag$/, // This is thrown when google tag manager is used in combination with an ad blocker + /^Can't find variable: gmo$/, // Error from Google Search App https://issuetracker.google.com/issues/396043331 "undefined is not an object (evaluating 'a.L')", // Random error that happens but not actionable or noticeable to end-users. 'can\'t redefine non-configurable property "solana"', // Probably a browser extension or custom browser (Brave) throwing this error "vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)", // Error thrown by GTM, seemingly not affecting end-users "Can't find variable: _AutofillCallbackHandler", // Unactionable error in instagram webview https://developers.facebook.com/community/threads/320013549791141/ /^Non-Error promise rejection captured with value: Object Not Found Matching Id:\d+, MethodName:simulateEvent, ParamCount:\d+$/, // unactionable error from CEFSharp, a .NET library that embeds chromium in .NET apps + /^Java exception was raised during method invocation$/, // error from Facebook Mobile browser (https://github.com/getsentry/sentry-javascript/issues/15065) ]; /** Options for the InboundFilters integration */ diff --git a/packages/core/test/lib/integrations/inboundfilters.test.ts b/packages/core/test/lib/integrations/inboundfilters.test.ts index 046ee5a168d7..e06c6bda0da2 100644 --- a/packages/core/test/lib/integrations/inboundfilters.test.ts +++ b/packages/core/test/lib/integrations/inboundfilters.test.ts @@ -269,6 +269,12 @@ const GOOGLETAG_EVENT: Event = { }, }; +const GOOGLE_APP_GMO: Event = { + exception: { + values: [{ type: 'ReferenceError', value: "Can't find variable: gmo" }], + }, +}; + const CEFSHARP_EVENT: Event = { exception: { values: [ @@ -281,6 +287,17 @@ const CEFSHARP_EVENT: Event = { }, }; +const FB_MOBILE_BROWSER_EVENT: Event = { + exception: { + values: [ + { + type: 'Error', + value: 'Java exception was raised during method invocation', + }, + ], + }, +}; + const MALFORMED_EVENT: Event = { exception: { values: [ @@ -397,11 +414,21 @@ describe('InboundFilters', () => { expect(eventProcessor(GOOGLETAG_EVENT, {})).toBe(null); }); + it('uses default filters (Google App "gmo")', () => { + const eventProcessor = createInboundFiltersEventProcessor(); + expect(eventProcessor(GOOGLE_APP_GMO, {})).toBe(null); + }); + it('uses default filters (CEFSharp)', () => { const eventProcessor = createInboundFiltersEventProcessor(); expect(eventProcessor(CEFSHARP_EVENT, {})).toBe(null); }); + it('uses default filters (FB Mobile Browser)', () => { + const eventProcessor = createInboundFiltersEventProcessor(); + expect(eventProcessor(FB_MOBILE_BROWSER_EVENT, {})).toBe(null); + }); + it('filters on last exception when multiple present', () => { const eventProcessor = createInboundFiltersEventProcessor({ ignoreErrors: ['incorrect type given for parameter `chewToy`'],