From 5aca7cab50963cfb6e1025fadae6ca42be1687fb Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Mon, 17 Feb 2025 17:30:44 +0100 Subject: [PATCH] fix(core): Filter out unactionable Facebook Mobile browser error (#15430) Filters out an unactionable error thrown by the Facebook Mobile browser web view. Closes https://github.com/getsentry/sentry-javascript/issues/15065 --- packages/core/src/integrations/inboundfilters.ts | 1 + .../test/lib/integrations/inboundfilters.test.ts | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/packages/core/src/integrations/inboundfilters.ts b/packages/core/src/integrations/inboundfilters.ts index 17b4442cee57..c006359d9361 100644 --- a/packages/core/src/integrations/inboundfilters.ts +++ b/packages/core/src/integrations/inboundfilters.ts @@ -19,6 +19,7 @@ const DEFAULT_IGNORE_ERRORS = [ "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..9f3e212e2c76 100644 --- a/packages/core/test/lib/integrations/inboundfilters.test.ts +++ b/packages/core/test/lib/integrations/inboundfilters.test.ts @@ -281,6 +281,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: [ @@ -402,6 +413,11 @@ describe('InboundFilters', () => { 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`'],