Skip to content

fix(core): Filter out unactionable Facebook Mobile browser error #15430

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Feb 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading