From 14d6b40d6ce05c8a80794496a4fdaf048d3a9e8f Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Wed, 20 Mar 2024 10:27:10 +0100 Subject: [PATCH 1/3] feat(core): Add Googletag error to InboundFilters default ignore list test biome :( --- .../core/src/integrations/inboundfilters.ts | 7 +++- .../lib/integrations/inboundfilters.test.ts | 34 ++++++++++++++++++- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/packages/core/src/integrations/inboundfilters.ts b/packages/core/src/integrations/inboundfilters.ts index 6ed891c253fa..9195f85b992e 100644 --- a/packages/core/src/integrations/inboundfilters.ts +++ b/packages/core/src/integrations/inboundfilters.ts @@ -6,7 +6,12 @@ import { convertIntegrationFnToClass, defineIntegration } from '../integration'; // "Script error." is hard coded into browsers for errors that it can't read. // this is the result of a script being pulled in from an external domain and CORS. -const DEFAULT_IGNORE_ERRORS = [/^Script error\.?$/, /^Javascript error: Script error\.? on line 0$/]; +const DEFAULT_IGNORE_ERRORS = [ + /^Script error\.?$/, + /^Javascript error: Script error\.? on line 0$/, + /^ResizeObserver loop completed with undelivered notifications.$/, + /^Cannot redefine property: googletag$/, +]; const DEFAULT_IGNORE_TRANSACTIONS = [ /^.*\/healthcheck$/, diff --git a/packages/core/test/lib/integrations/inboundfilters.test.ts b/packages/core/test/lib/integrations/inboundfilters.test.ts index 24783b8eeb68..f98b09cfd8fc 100644 --- a/packages/core/test/lib/integrations/inboundfilters.test.ts +++ b/packages/core/test/lib/integrations/inboundfilters.test.ts @@ -188,6 +188,28 @@ const SCRIPT_ERROR_EVENT: Event = { }, }; +const RESIZEOBSERVER_EVENT: Event = { + exception: { + values: [ + { + type: 'Error', + value: 'ResizeObserver loop completed with undelivered notifications.', + }, + ], + }, +}; + +const GOOGLETAG_EVENT: Event = { + exception: { + values: [ + { + type: 'TypeError', + value: 'Cannot redefine property: googletag', + }, + ], + }, +}; + const MALFORMED_EVENT: Event = { exception: { values: [ @@ -304,11 +326,21 @@ describe('InboundFilters', () => { expect(eventProcessor(EXCEPTION_EVENT, {})).toBe(null); }); - it('uses default filters', () => { + it('uses default filters (script error)', () => { const eventProcessor = createInboundFiltersEventProcessor(); expect(eventProcessor(SCRIPT_ERROR_EVENT, {})).toBe(null); }); + it('uses default filters (ResizeObserver)', () => { + const eventProcessor = createInboundFiltersEventProcessor(); + expect(eventProcessor(RESIZEOBSERVER_EVENT, {})).toBe(null); + }); + + it('uses default filters (googletag)', () => { + const eventProcessor = createInboundFiltersEventProcessor(); + expect(eventProcessor(GOOGLETAG_EVENT, {})).toBe(null); + }); + it('filters on last exception when multiple present', () => { const eventProcessor = createInboundFiltersEventProcessor({ ignoreErrors: ['incorrect type given for parameter `chewToy`'], From 188bbe4dffe6235c2741905c951640c9540c93e2 Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Wed, 20 Mar 2024 13:50:34 +0100 Subject: [PATCH 2/3] Trigger Build From 042b3b2fecc50c08dfa5c1125417b358bbdf23df Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Wed, 20 Mar 2024 14:57:45 +0100 Subject: [PATCH 3/3] increase size limit :( --- .size-limit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.size-limit.js b/.size-limit.js index 79313d5aa0ac..f4694e8e1608 100644 --- a/.size-limit.js +++ b/.size-limit.js @@ -52,7 +52,7 @@ module.exports = [ path: 'packages/browser/build/npm/esm/index.js', import: '{ init, browserTracingIntegration }', gzip: true, - limit: '36 KB', + limit: '37 KB', }, { name: '@sentry/browser (incl. Feedback) - Webpack (gzipped)',