Skip to content

Commit

Permalink
fix(v8/core): Filter gmo error and Facebook mobile error (#15447)
Browse files Browse the repository at this point in the history
backport of #15432
and #15430

---------

Co-authored-by: Lukas Stracke <lukas.stracke@sentry.io>
  • Loading branch information
s1gr1d and Lms24 authored Feb 20, 2025
1 parent 831b19c commit 9f1a17e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/core/src/integrations/inboundfilters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
27 changes: 27 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,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: [
Expand All @@ -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: [
Expand Down Expand Up @@ -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`'],
Expand Down

0 comments on commit 9f1a17e

Please sign in to comment.