Skip to content

Commit

Permalink
fix(core): Filter out unactionable Facebook Mobile browser error (#15430
Browse files Browse the repository at this point in the history
)

Filters out an unactionable error thrown by the Facebook Mobile browser
web view.

Closes #15065
  • Loading branch information
Lms24 authored Feb 17, 2025
1 parent 6363e75 commit 5aca7ca
Show file tree
Hide file tree
Showing 2 changed files with 17 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 @@ -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 */
Expand Down
16 changes: 16 additions & 0 deletions packages/core/test/lib/integrations/inboundfilters.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down Expand Up @@ -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`'],
Expand Down

0 comments on commit 5aca7ca

Please sign in to comment.