Skip to content
Draft
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
3 changes: 2 additions & 1 deletion packages/core/src/integrations/eventFilters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ const DEFAULT_IGNORE_ERRORS = [
/vv\(\)\.getRestrictions is not a function/, // 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/
/Object Not Found Matching Id:\d+, MethodName:simulateEvent/, // 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)
/Java exception was raised during method invocation$/, // error from Facebook Mobile browser (https://github.com/getsentry/sentry-javascript/issues/15065, https://github.com/getsentry/sentry-javascript/issues/23733)
/Java object is gone$/, // error from Facebook Mobile browser (https://github.com/getsentry/sentry-javascript/issues/15065, https://github.com/getsentry/sentry-javascript/issues/23733)
];

/** Options for the EventFilters integration */
Expand Down
32 changes: 32 additions & 0 deletions packages/core/test/lib/integrations/eventFilters.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,28 @@ const FB_MOBILE_BROWSER_EVENT: Event = {
},
};

const FB_MOBILE_BROWSER_POST_MESSAGE_EVENT: Event = {
exception: {
values: [
{
type: 'Error',
value: 'Error invoking postMessage: Java exception was raised during method invocation',
},
],
},
};

const FB_MOBILE_BROWSER_JAVA_OBJECT_GONE_EVENT: Event = {
exception: {
values: [
{
type: 'Error',
value: 'Error invoking postMessage: Java object is gone',
},
],
},
};

const MALFORMED_EVENT: Event = {
exception: {
values: [
Expand Down Expand Up @@ -497,6 +519,16 @@ describe('EventFilters', () => {
expect(eventProcessor(FB_MOBILE_BROWSER_EVENT, {})).toBe(null);
});

it('uses default filters (FB Mobile Browser, wrapped in postMessage error)', () => {
const eventProcessor = createEventFiltersEventProcessor(integrationFn);
expect(eventProcessor(FB_MOBILE_BROWSER_POST_MESSAGE_EVENT, {})).toBe(null);
});

it('uses default filters (FB Mobile Browser, Java object is gone)', () => {
const eventProcessor = createEventFiltersEventProcessor(integrationFn);
expect(eventProcessor(FB_MOBILE_BROWSER_JAVA_OBJECT_GONE_EVENT, {})).toBe(null);
});

it("uses default filters (undefined is not an object (evaluating 'a.L'))", () => {
const eventProcessor = createEventFiltersEventProcessor(integrationFn);
expect(eventProcessor(createUndefinedIsNotAnObjectEvent('a.L'), {})).toBe(null);
Expand Down
Loading