Skip to content

Commit

Permalink
fix(core): Filter out unactionable CEFSharp promise rejection error b…
Browse files Browse the repository at this point in the history
…y default
  • Loading branch information
Lms24 committed Dec 7, 2024
1 parent a985d64 commit 54b573c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/core/src/integrations/inboundfilters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
17 changes: 17 additions & 0 deletions packages/core/test/lib/integrations/inboundfilters.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down Expand Up @@ -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`'],
Expand Down

0 comments on commit 54b573c

Please sign in to comment.