From 54b573c300dff8152cd8167b1574f8eaf91b09fe Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Thu, 5 Dec 2024 17:13:51 +0100 Subject: [PATCH] fix(core): Filter out unactionable CEFSharp promise rejection error by default --- .../core/src/integrations/inboundfilters.ts | 1 + .../lib/integrations/inboundfilters.test.ts | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/packages/core/src/integrations/inboundfilters.ts b/packages/core/src/integrations/inboundfilters.ts index c78b602d3304..9d9f803a69f5 100644 --- a/packages/core/src/integrations/inboundfilters.ts +++ b/packages/core/src/integrations/inboundfilters.ts @@ -17,6 +17,7 @@ const DEFAULT_IGNORE_ERRORS = [ '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 ]; /** 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 13d6d783adf6..046ee5a168d7 100644 --- a/packages/core/test/lib/integrations/inboundfilters.test.ts +++ b/packages/core/test/lib/integrations/inboundfilters.test.ts @@ -269,6 +269,18 @@ const GOOGLETAG_EVENT: Event = { }, }; +const CEFSHARP_EVENT: Event = { + exception: { + values: [ + { + type: 'TypeError', + value: + 'Non-Error promise rejection captured with value: Object Not Found Matching Id:3, MethodName:simulateEvent, ParamCount:1', + }, + ], + }, +}; + const MALFORMED_EVENT: Event = { exception: { values: [ @@ -385,6 +397,11 @@ describe('InboundFilters', () => { expect(eventProcessor(GOOGLETAG_EVENT, {})).toBe(null); }); + it('uses default filters (CEFSharp)', () => { + const eventProcessor = createInboundFiltersEventProcessor(); + expect(eventProcessor(CEFSHARP_EVENT, {})).toBe(null); + }); + it('filters on last exception when multiple present', () => { const eventProcessor = createInboundFiltersEventProcessor({ ignoreErrors: ['incorrect type given for parameter `chewToy`'],