Skip to content

Commit 9f1a17e

Browse files
s1gr1dLms24
andauthored
fix(v8/core): Filter gmo error and Facebook mobile error (#15447)
backport of #15432 and #15430 --------- Co-authored-by: Lukas Stracke <[email protected]>
1 parent 831b19c commit 9f1a17e

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

packages/core/src/integrations/inboundfilters.ts

+2
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ const DEFAULT_IGNORE_ERRORS = [
1313
/^Javascript error: Script error\.? on line 0$/,
1414
/^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.
1515
/^Cannot redefine property: googletag$/, // This is thrown when google tag manager is used in combination with an ad blocker
16+
/^Can't find variable: gmo$/, // Error from Google Search App https://issuetracker.google.com/issues/396043331
1617
"undefined is not an object (evaluating 'a.L')", // Random error that happens but not actionable or noticeable to end-users.
1718
'can\'t redefine non-configurable property "solana"', // Probably a browser extension or custom browser (Brave) throwing this error
1819
"vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)", // Error thrown by GTM, seemingly not affecting end-users
1920
"Can't find variable: _AutofillCallbackHandler", // Unactionable error in instagram webview https://developers.facebook.com/community/threads/320013549791141/
2021
/^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
22+
/^Java exception was raised during method invocation$/, // error from Facebook Mobile browser (https://github.com/getsentry/sentry-javascript/issues/15065)
2123
];
2224

2325
/** Options for the InboundFilters integration */

packages/core/test/lib/integrations/inboundfilters.test.ts

+27
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,12 @@ const GOOGLETAG_EVENT: Event = {
269269
},
270270
};
271271

272+
const GOOGLE_APP_GMO: Event = {
273+
exception: {
274+
values: [{ type: 'ReferenceError', value: "Can't find variable: gmo" }],
275+
},
276+
};
277+
272278
const CEFSHARP_EVENT: Event = {
273279
exception: {
274280
values: [
@@ -281,6 +287,17 @@ const CEFSHARP_EVENT: Event = {
281287
},
282288
};
283289

290+
const FB_MOBILE_BROWSER_EVENT: Event = {
291+
exception: {
292+
values: [
293+
{
294+
type: 'Error',
295+
value: 'Java exception was raised during method invocation',
296+
},
297+
],
298+
},
299+
};
300+
284301
const MALFORMED_EVENT: Event = {
285302
exception: {
286303
values: [
@@ -397,11 +414,21 @@ describe('InboundFilters', () => {
397414
expect(eventProcessor(GOOGLETAG_EVENT, {})).toBe(null);
398415
});
399416

417+
it('uses default filters (Google App "gmo")', () => {
418+
const eventProcessor = createInboundFiltersEventProcessor();
419+
expect(eventProcessor(GOOGLE_APP_GMO, {})).toBe(null);
420+
});
421+
400422
it('uses default filters (CEFSharp)', () => {
401423
const eventProcessor = createInboundFiltersEventProcessor();
402424
expect(eventProcessor(CEFSHARP_EVENT, {})).toBe(null);
403425
});
404426

427+
it('uses default filters (FB Mobile Browser)', () => {
428+
const eventProcessor = createInboundFiltersEventProcessor();
429+
expect(eventProcessor(FB_MOBILE_BROWSER_EVENT, {})).toBe(null);
430+
});
431+
405432
it('filters on last exception when multiple present', () => {
406433
const eventProcessor = createInboundFiltersEventProcessor({
407434
ignoreErrors: ['incorrect type given for parameter `chewToy`'],

0 commit comments

Comments
 (0)