From 79932b3d969baa0c4c407378dcf5ccf506c3ee67 Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Thu, 31 Jul 2025 10:38:08 +0200 Subject: [PATCH 1/5] ref(browser): Set more descriptive `mechanism.type` in `browserApiErrorsIntergation` --- packages/browser/src/helpers.ts | 1 + packages/browser/src/integrations/browserapierrors.ts | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/browser/src/helpers.ts b/packages/browser/src/helpers.ts index 362020a8d845..93c87e1d6161 100644 --- a/packages/browser/src/helpers.ts +++ b/packages/browser/src/helpers.ts @@ -133,6 +133,7 @@ export function wrap( return event; }); + // no need to add a mechanism here, we already add it via an event processor above captureException(ex); }); diff --git a/packages/browser/src/integrations/browserapierrors.ts b/packages/browser/src/integrations/browserapierrors.ts index 6db6d40c67c2..1e2f818d8ddc 100644 --- a/packages/browser/src/integrations/browserapierrors.ts +++ b/packages/browser/src/integrations/browserapierrors.ts @@ -110,7 +110,7 @@ function _wrapTimeFunction(original: () => void): () => number { mechanism: { data: { function: getFunctionName(original) }, handled: false, - type: 'instrument', + type: 'browserApiErrors', }, }); return original.apply(this, args); @@ -127,7 +127,7 @@ function _wrapRAF(original: () => void): (callback: () => void) => unknown { handler: getFunctionName(original), }, handled: false, - type: 'instrument', + type: 'browserApiErrors', }, }), ]); @@ -150,7 +150,7 @@ function _wrapXHR(originalSend: () => void): () => void { handler: getFunctionName(original), }, handled: false, - type: 'instrument', + type: 'browserApiErrors', }, }; @@ -199,7 +199,7 @@ function _wrapEventTarget(target: string, integrationOptions: BrowserApiErrorsOp target, }, handled: false, - type: 'instrument', + type: 'browserApiErrors', }, }); } @@ -221,7 +221,7 @@ function _wrapEventTarget(target: string, integrationOptions: BrowserApiErrorsOp target, }, handled: false, - type: 'instrument', + type: 'browserApiErrors', }, }), options, From 1f95a2fda98a9b0949aa7ecb08c9621d6908da04 Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Thu, 31 Jul 2025 12:49:58 +0200 Subject: [PATCH 2/5] adjust integration tests --- .../instrumentation/eventListener/event-target/test.ts | 2 +- .../instrumentation/eventListener/named-function/test.ts | 2 +- .../public-api/instrumentation/eventListener/remove/test.ts | 2 +- .../instrumentation/eventListener/thrown-error/test.ts | 2 +- .../instrumentation/requestAnimationFrame/thrown-errors/test.ts | 2 +- .../suites/public-api/instrumentation/setInterval/test.ts | 2 +- .../suites/public-api/instrumentation/setTimeout/test.ts | 2 +- .../suites/public-api/instrumentation/setTimeoutFrozen/test.ts | 2 +- .../suites/public-api/instrumentation/xhr/thrown-error/test.ts | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dev-packages/browser-integration-tests/suites/public-api/instrumentation/eventListener/event-target/test.ts b/dev-packages/browser-integration-tests/suites/public-api/instrumentation/eventListener/event-target/test.ts index c2d0ed42d4f4..98b437f50265 100644 --- a/dev-packages/browser-integration-tests/suites/public-api/instrumentation/eventListener/event-target/test.ts +++ b/dev-packages/browser-integration-tests/suites/public-api/instrumentation/eventListener/event-target/test.ts @@ -13,7 +13,7 @@ sentryTest('should capture target name in mechanism data', async ({ getLocalTest type: 'Error', value: 'event_listener_error', mechanism: { - type: 'instrument', + type: 'browserApiErrors', handled: false, data: { function: 'addEventListener', diff --git a/dev-packages/browser-integration-tests/suites/public-api/instrumentation/eventListener/named-function/test.ts b/dev-packages/browser-integration-tests/suites/public-api/instrumentation/eventListener/named-function/test.ts index cee945ec8cdb..70d1da8b86db 100644 --- a/dev-packages/browser-integration-tests/suites/public-api/instrumentation/eventListener/named-function/test.ts +++ b/dev-packages/browser-integration-tests/suites/public-api/instrumentation/eventListener/named-function/test.ts @@ -13,7 +13,7 @@ sentryTest('should capture built-in handlers fn name in mechanism data', async ( type: 'Error', value: 'event_listener_error', mechanism: { - type: 'instrument', + type: 'browserApiErrors', handled: false, data: { function: 'addEventListener', diff --git a/dev-packages/browser-integration-tests/suites/public-api/instrumentation/eventListener/remove/test.ts b/dev-packages/browser-integration-tests/suites/public-api/instrumentation/eventListener/remove/test.ts index cf643d796274..0b91d2b61cf5 100644 --- a/dev-packages/browser-integration-tests/suites/public-api/instrumentation/eventListener/remove/test.ts +++ b/dev-packages/browser-integration-tests/suites/public-api/instrumentation/eventListener/remove/test.ts @@ -13,7 +13,7 @@ sentryTest('should transparently remove event listeners from wrapped functions', type: 'Error', value: 'foo', mechanism: { - type: 'instrument', + type: 'browserApiErrors', handled: false, }, stacktrace: { diff --git a/dev-packages/browser-integration-tests/suites/public-api/instrumentation/eventListener/thrown-error/test.ts b/dev-packages/browser-integration-tests/suites/public-api/instrumentation/eventListener/thrown-error/test.ts index 9a849fd22b88..41a0ae8deb6c 100644 --- a/dev-packages/browser-integration-tests/suites/public-api/instrumentation/eventListener/thrown-error/test.ts +++ b/dev-packages/browser-integration-tests/suites/public-api/instrumentation/eventListener/thrown-error/test.ts @@ -15,7 +15,7 @@ sentryTest( type: 'Error', value: 'event_listener_error', mechanism: { - type: 'instrument', + type: 'browserApiErrors', handled: false, data: { function: 'addEventListener', diff --git a/dev-packages/browser-integration-tests/suites/public-api/instrumentation/requestAnimationFrame/thrown-errors/test.ts b/dev-packages/browser-integration-tests/suites/public-api/instrumentation/requestAnimationFrame/thrown-errors/test.ts index 02b8771d1785..cac1e19ae71b 100644 --- a/dev-packages/browser-integration-tests/suites/public-api/instrumentation/requestAnimationFrame/thrown-errors/test.ts +++ b/dev-packages/browser-integration-tests/suites/public-api/instrumentation/requestAnimationFrame/thrown-errors/test.ts @@ -13,7 +13,7 @@ sentryTest('should capture exceptions inside callback', async ({ getLocalTestUrl type: 'Error', value: 'requestAnimationFrame_error', mechanism: { - type: 'instrument', + type: 'browserApiErrors', handled: false, }, stacktrace: { diff --git a/dev-packages/browser-integration-tests/suites/public-api/instrumentation/setInterval/test.ts b/dev-packages/browser-integration-tests/suites/public-api/instrumentation/setInterval/test.ts index 02942b276a3a..d1f444e9f8cc 100644 --- a/dev-packages/browser-integration-tests/suites/public-api/instrumentation/setInterval/test.ts +++ b/dev-packages/browser-integration-tests/suites/public-api/instrumentation/setInterval/test.ts @@ -13,7 +13,7 @@ sentryTest('Instrumentation should capture errors in setInterval', async ({ getL type: 'Error', value: 'setInterval_error', mechanism: { - type: 'instrument', + type: 'browserApiErrors', handled: false, }, stacktrace: { diff --git a/dev-packages/browser-integration-tests/suites/public-api/instrumentation/setTimeout/test.ts b/dev-packages/browser-integration-tests/suites/public-api/instrumentation/setTimeout/test.ts index 321a96d7b393..9b1f4285fa7f 100644 --- a/dev-packages/browser-integration-tests/suites/public-api/instrumentation/setTimeout/test.ts +++ b/dev-packages/browser-integration-tests/suites/public-api/instrumentation/setTimeout/test.ts @@ -13,7 +13,7 @@ sentryTest('Instrumentation should capture errors in setTimeout', async ({ getLo type: 'Error', value: 'setTimeout_error', mechanism: { - type: 'instrument', + type: 'browserApiErrors', handled: false, data: { function: 'setTimeout', diff --git a/dev-packages/browser-integration-tests/suites/public-api/instrumentation/setTimeoutFrozen/test.ts b/dev-packages/browser-integration-tests/suites/public-api/instrumentation/setTimeoutFrozen/test.ts index c4322884cfe6..c80a84242ab8 100644 --- a/dev-packages/browser-integration-tests/suites/public-api/instrumentation/setTimeoutFrozen/test.ts +++ b/dev-packages/browser-integration-tests/suites/public-api/instrumentation/setTimeoutFrozen/test.ts @@ -25,7 +25,7 @@ sentryTest( type: 'Error', value: 'setTimeout_error', mechanism: { - type: 'instrument', + type: 'browserApiErrors', handled: false, }, stacktrace: { diff --git a/dev-packages/browser-integration-tests/suites/public-api/instrumentation/xhr/thrown-error/test.ts b/dev-packages/browser-integration-tests/suites/public-api/instrumentation/xhr/thrown-error/test.ts index 330c94761854..6af889f9428e 100644 --- a/dev-packages/browser-integration-tests/suites/public-api/instrumentation/xhr/thrown-error/test.ts +++ b/dev-packages/browser-integration-tests/suites/public-api/instrumentation/xhr/thrown-error/test.ts @@ -15,7 +15,7 @@ sentryTest( type: 'Error', value: 'xhr_error', mechanism: { - type: 'instrument', + type: 'public-api/instrumentation', handled: false, data: { function: 'onreadystatechange', From 5891590c26ffd7afa57dbdf93bdb39eafb76bf2e Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Thu, 31 Jul 2025 12:52:16 +0200 Subject: [PATCH 3/5] adjust ember, svelte, remix tests --- .../test-applications/ember-classic/tests/errors.test.ts | 4 ++-- .../e2e-tests/test-applications/svelte-5/tests/errors.test.ts | 2 +- .../remix/test/integration/test/client/click-error.test.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dev-packages/e2e-tests/test-applications/ember-classic/tests/errors.test.ts b/dev-packages/e2e-tests/test-applications/ember-classic/tests/errors.test.ts index 2e836cf8b756..04e3d7ec0509 100644 --- a/dev-packages/e2e-tests/test-applications/ember-classic/tests/errors.test.ts +++ b/dev-packages/e2e-tests/test-applications/ember-classic/tests/errors.test.ts @@ -19,7 +19,7 @@ test('sends an error', async ({ page }) => { type: 'TypeError', value: 'this.nonExistentFunction is not a function', mechanism: { - type: 'instrument', + type: 'browserApiErrors', handled: false, }, }, @@ -55,7 +55,7 @@ test('assigns the correct transaction value after a navigation', async ({ page } type: 'TypeError', value: 'this.nonExistentFunction is not a function', mechanism: { - type: 'instrument', + type: 'browserApiErrors', handled: false, }, }, diff --git a/dev-packages/e2e-tests/test-applications/svelte-5/tests/errors.test.ts b/dev-packages/e2e-tests/test-applications/svelte-5/tests/errors.test.ts index 6e3267eab2ed..1d1c99e74322 100644 --- a/dev-packages/e2e-tests/test-applications/svelte-5/tests/errors.test.ts +++ b/dev-packages/e2e-tests/test-applications/svelte-5/tests/errors.test.ts @@ -19,7 +19,7 @@ test('sends an error', async ({ page }) => { type: 'Error', value: 'Error thrown from Svelte 5 E2E test app', mechanism: { - type: 'instrument', + type: 'browserApiErrors', handled: false, }, }, diff --git a/packages/remix/test/integration/test/client/click-error.test.ts b/packages/remix/test/integration/test/client/click-error.test.ts index c8c70105708f..14c6d0cd0acf 100644 --- a/packages/remix/test/integration/test/client/click-error.test.ts +++ b/packages/remix/test/integration/test/client/click-error.test.ts @@ -20,7 +20,7 @@ test('should report a manually captured message on click with the correct stackt type: 'Error', value: 'ClickError', stacktrace: { frames: expect.any(Array) }, - mechanism: { type: 'instrument', handled: false }, + mechanism: { type: 'browserApiErrors', handled: false }, }, ]); From 8e67f68b65e7d05659db81a5db36f890c4e72142 Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Thu, 31 Jul 2025 13:20:20 +0200 Subject: [PATCH 4/5] never trust cursor --- .../suites/public-api/instrumentation/xhr/thrown-error/test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-packages/browser-integration-tests/suites/public-api/instrumentation/xhr/thrown-error/test.ts b/dev-packages/browser-integration-tests/suites/public-api/instrumentation/xhr/thrown-error/test.ts index 6af889f9428e..692b40321c9b 100644 --- a/dev-packages/browser-integration-tests/suites/public-api/instrumentation/xhr/thrown-error/test.ts +++ b/dev-packages/browser-integration-tests/suites/public-api/instrumentation/xhr/thrown-error/test.ts @@ -15,7 +15,7 @@ sentryTest( type: 'Error', value: 'xhr_error', mechanism: { - type: 'public-api/instrumentation', + type: 'browserApiErrors', handled: false, data: { function: 'onreadystatechange', From f5bf5d1e444fc56aeabfb1f02cef9171a5a4ddac Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Fri, 1 Aug 2025 15:28:24 +0200 Subject: [PATCH 5/5] adjust type to match trace origin spec --- .../eventListener/event-target/test.ts | 3 +-- .../eventListener/named-function/test.ts | 3 +-- .../instrumentation/eventListener/remove/test.ts | 2 +- .../eventListener/thrown-error/test.ts | 3 +-- .../requestAnimationFrame/thrown-errors/test.ts | 2 +- .../instrumentation/setInterval/test.ts | 2 +- .../public-api/instrumentation/setTimeout/test.ts | 5 +---- .../instrumentation/setTimeoutFrozen/test.ts | 2 +- .../instrumentation/xhr/thrown-error/test.ts | 5 +---- .../ember-classic/tests/errors.test.ts | 4 ++-- .../svelte-5/tests/errors.test.ts | 2 +- .../browser/src/integrations/browserapierrors.ts | 15 +++++---------- .../integration/test/client/click-error.test.ts | 2 +- 13 files changed, 18 insertions(+), 32 deletions(-) diff --git a/dev-packages/browser-integration-tests/suites/public-api/instrumentation/eventListener/event-target/test.ts b/dev-packages/browser-integration-tests/suites/public-api/instrumentation/eventListener/event-target/test.ts index 98b437f50265..084379366c9a 100644 --- a/dev-packages/browser-integration-tests/suites/public-api/instrumentation/eventListener/event-target/test.ts +++ b/dev-packages/browser-integration-tests/suites/public-api/instrumentation/eventListener/event-target/test.ts @@ -13,10 +13,9 @@ sentryTest('should capture target name in mechanism data', async ({ getLocalTest type: 'Error', value: 'event_listener_error', mechanism: { - type: 'browserApiErrors', + type: 'auto.browser.browserapierrors.addEventListener', handled: false, data: { - function: 'addEventListener', handler: 'functionListener', target: 'EventTarget', }, diff --git a/dev-packages/browser-integration-tests/suites/public-api/instrumentation/eventListener/named-function/test.ts b/dev-packages/browser-integration-tests/suites/public-api/instrumentation/eventListener/named-function/test.ts index 70d1da8b86db..ba72afd447d3 100644 --- a/dev-packages/browser-integration-tests/suites/public-api/instrumentation/eventListener/named-function/test.ts +++ b/dev-packages/browser-integration-tests/suites/public-api/instrumentation/eventListener/named-function/test.ts @@ -13,10 +13,9 @@ sentryTest('should capture built-in handlers fn name in mechanism data', async ( type: 'Error', value: 'event_listener_error', mechanism: { - type: 'browserApiErrors', + type: 'auto.browser.browserapierrors.addEventListener', handled: false, data: { - function: 'addEventListener', handler: 'clickHandler', target: 'EventTarget', }, diff --git a/dev-packages/browser-integration-tests/suites/public-api/instrumentation/eventListener/remove/test.ts b/dev-packages/browser-integration-tests/suites/public-api/instrumentation/eventListener/remove/test.ts index 0b91d2b61cf5..4d7a1b101e0d 100644 --- a/dev-packages/browser-integration-tests/suites/public-api/instrumentation/eventListener/remove/test.ts +++ b/dev-packages/browser-integration-tests/suites/public-api/instrumentation/eventListener/remove/test.ts @@ -13,7 +13,7 @@ sentryTest('should transparently remove event listeners from wrapped functions', type: 'Error', value: 'foo', mechanism: { - type: 'browserApiErrors', + type: 'auto.browser.browserapierrors.addEventListener', handled: false, }, stacktrace: { diff --git a/dev-packages/browser-integration-tests/suites/public-api/instrumentation/eventListener/thrown-error/test.ts b/dev-packages/browser-integration-tests/suites/public-api/instrumentation/eventListener/thrown-error/test.ts index 41a0ae8deb6c..c36f5fb73412 100644 --- a/dev-packages/browser-integration-tests/suites/public-api/instrumentation/eventListener/thrown-error/test.ts +++ b/dev-packages/browser-integration-tests/suites/public-api/instrumentation/eventListener/thrown-error/test.ts @@ -15,10 +15,9 @@ sentryTest( type: 'Error', value: 'event_listener_error', mechanism: { - type: 'browserApiErrors', + type: 'auto.browser.browserapierrors.addEventListener', handled: false, data: { - function: 'addEventListener', handler: '', target: 'EventTarget', }, diff --git a/dev-packages/browser-integration-tests/suites/public-api/instrumentation/requestAnimationFrame/thrown-errors/test.ts b/dev-packages/browser-integration-tests/suites/public-api/instrumentation/requestAnimationFrame/thrown-errors/test.ts index cac1e19ae71b..30565ea48a20 100644 --- a/dev-packages/browser-integration-tests/suites/public-api/instrumentation/requestAnimationFrame/thrown-errors/test.ts +++ b/dev-packages/browser-integration-tests/suites/public-api/instrumentation/requestAnimationFrame/thrown-errors/test.ts @@ -13,7 +13,7 @@ sentryTest('should capture exceptions inside callback', async ({ getLocalTestUrl type: 'Error', value: 'requestAnimationFrame_error', mechanism: { - type: 'browserApiErrors', + type: 'auto.browser.browserapierrors.requestAnimationFrame', handled: false, }, stacktrace: { diff --git a/dev-packages/browser-integration-tests/suites/public-api/instrumentation/setInterval/test.ts b/dev-packages/browser-integration-tests/suites/public-api/instrumentation/setInterval/test.ts index d1f444e9f8cc..9be24f4e4e57 100644 --- a/dev-packages/browser-integration-tests/suites/public-api/instrumentation/setInterval/test.ts +++ b/dev-packages/browser-integration-tests/suites/public-api/instrumentation/setInterval/test.ts @@ -13,7 +13,7 @@ sentryTest('Instrumentation should capture errors in setInterval', async ({ getL type: 'Error', value: 'setInterval_error', mechanism: { - type: 'browserApiErrors', + type: 'auto.browser.browserapierrors.setInterval', handled: false, }, stacktrace: { diff --git a/dev-packages/browser-integration-tests/suites/public-api/instrumentation/setTimeout/test.ts b/dev-packages/browser-integration-tests/suites/public-api/instrumentation/setTimeout/test.ts index 9b1f4285fa7f..3045f633f8c0 100644 --- a/dev-packages/browser-integration-tests/suites/public-api/instrumentation/setTimeout/test.ts +++ b/dev-packages/browser-integration-tests/suites/public-api/instrumentation/setTimeout/test.ts @@ -13,11 +13,8 @@ sentryTest('Instrumentation should capture errors in setTimeout', async ({ getLo type: 'Error', value: 'setTimeout_error', mechanism: { - type: 'browserApiErrors', + type: 'auto.browser.browserapierrors.setTimeout', handled: false, - data: { - function: 'setTimeout', - }, }, stacktrace: { frames: expect.any(Array), diff --git a/dev-packages/browser-integration-tests/suites/public-api/instrumentation/setTimeoutFrozen/test.ts b/dev-packages/browser-integration-tests/suites/public-api/instrumentation/setTimeoutFrozen/test.ts index c80a84242ab8..4c6f9280aee0 100644 --- a/dev-packages/browser-integration-tests/suites/public-api/instrumentation/setTimeoutFrozen/test.ts +++ b/dev-packages/browser-integration-tests/suites/public-api/instrumentation/setTimeoutFrozen/test.ts @@ -25,7 +25,7 @@ sentryTest( type: 'Error', value: 'setTimeout_error', mechanism: { - type: 'browserApiErrors', + type: 'auto.browser.browserapierrors.setTimeout', handled: false, }, stacktrace: { diff --git a/dev-packages/browser-integration-tests/suites/public-api/instrumentation/xhr/thrown-error/test.ts b/dev-packages/browser-integration-tests/suites/public-api/instrumentation/xhr/thrown-error/test.ts index 692b40321c9b..e91081a71f97 100644 --- a/dev-packages/browser-integration-tests/suites/public-api/instrumentation/xhr/thrown-error/test.ts +++ b/dev-packages/browser-integration-tests/suites/public-api/instrumentation/xhr/thrown-error/test.ts @@ -15,11 +15,8 @@ sentryTest( type: 'Error', value: 'xhr_error', mechanism: { - type: 'browserApiErrors', + type: 'auto.browser.browserapierrors.xhr.onreadystatechange', handled: false, - data: { - function: 'onreadystatechange', - }, }, stacktrace: { frames: expect.any(Array), diff --git a/dev-packages/e2e-tests/test-applications/ember-classic/tests/errors.test.ts b/dev-packages/e2e-tests/test-applications/ember-classic/tests/errors.test.ts index 04e3d7ec0509..3f4b1f5c099e 100644 --- a/dev-packages/e2e-tests/test-applications/ember-classic/tests/errors.test.ts +++ b/dev-packages/e2e-tests/test-applications/ember-classic/tests/errors.test.ts @@ -19,7 +19,7 @@ test('sends an error', async ({ page }) => { type: 'TypeError', value: 'this.nonExistentFunction is not a function', mechanism: { - type: 'browserApiErrors', + type: 'auto.browser.browserapierrors.addEventListener', handled: false, }, }, @@ -55,7 +55,7 @@ test('assigns the correct transaction value after a navigation', async ({ page } type: 'TypeError', value: 'this.nonExistentFunction is not a function', mechanism: { - type: 'browserApiErrors', + type: 'auto.browser.browserapierrors.addEventListener', handled: false, }, }, diff --git a/dev-packages/e2e-tests/test-applications/svelte-5/tests/errors.test.ts b/dev-packages/e2e-tests/test-applications/svelte-5/tests/errors.test.ts index 1d1c99e74322..d536aa0ab928 100644 --- a/dev-packages/e2e-tests/test-applications/svelte-5/tests/errors.test.ts +++ b/dev-packages/e2e-tests/test-applications/svelte-5/tests/errors.test.ts @@ -19,7 +19,7 @@ test('sends an error', async ({ page }) => { type: 'Error', value: 'Error thrown from Svelte 5 E2E test app', mechanism: { - type: 'browserApiErrors', + type: 'auto.browser.browserapierrors.addEventListener', handled: false, }, }, diff --git a/packages/browser/src/integrations/browserapierrors.ts b/packages/browser/src/integrations/browserapierrors.ts index 1e2f818d8ddc..7e94c2bc7167 100644 --- a/packages/browser/src/integrations/browserapierrors.ts +++ b/packages/browser/src/integrations/browserapierrors.ts @@ -108,9 +108,8 @@ function _wrapTimeFunction(original: () => void): () => number { const originalCallback = args[0]; args[0] = wrap(originalCallback, { mechanism: { - data: { function: getFunctionName(original) }, handled: false, - type: 'browserApiErrors', + type: `auto.browser.browserapierrors.${getFunctionName(original)}`, }, }); return original.apply(this, args); @@ -123,11 +122,10 @@ function _wrapRAF(original: () => void): (callback: () => void) => unknown { wrap(callback, { mechanism: { data: { - function: 'requestAnimationFrame', handler: getFunctionName(original), }, handled: false, - type: 'browserApiErrors', + type: 'auto.browser.browserapierrors.requestAnimationFrame', }, }), ]); @@ -146,11 +144,10 @@ function _wrapXHR(originalSend: () => void): () => void { const wrapOptions = { mechanism: { data: { - function: prop, handler: getFunctionName(original), }, handled: false, - type: 'browserApiErrors', + type: `auto.browser.browserapierrors.xhr.${prop}`, }, }; @@ -194,12 +191,11 @@ function _wrapEventTarget(target: string, integrationOptions: BrowserApiErrorsOp fn.handleEvent = wrap(fn.handleEvent, { mechanism: { data: { - function: 'handleEvent', handler: getFunctionName(fn), target, }, handled: false, - type: 'browserApiErrors', + type: 'auto.browser.browserapierrors.handleEvent', }, }); } @@ -216,12 +212,11 @@ function _wrapEventTarget(target: string, integrationOptions: BrowserApiErrorsOp wrap(fn, { mechanism: { data: { - function: 'addEventListener', handler: getFunctionName(fn), target, }, handled: false, - type: 'browserApiErrors', + type: 'auto.browser.browserapierrors.addEventListener', }, }), options, diff --git a/packages/remix/test/integration/test/client/click-error.test.ts b/packages/remix/test/integration/test/client/click-error.test.ts index 14c6d0cd0acf..78573bb9782a 100644 --- a/packages/remix/test/integration/test/client/click-error.test.ts +++ b/packages/remix/test/integration/test/client/click-error.test.ts @@ -20,7 +20,7 @@ test('should report a manually captured message on click with the correct stackt type: 'Error', value: 'ClickError', stacktrace: { frames: expect.any(Array) }, - mechanism: { type: 'browserApiErrors', handled: false }, + mechanism: { type: 'auto.browser.browserapierrors.addEventListener', handled: false }, }, ]);