From 91d2c9f8b018381de39cb62b4686c4e1e255f1e1 Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Tue, 29 Aug 2023 13:04:36 +0200 Subject: [PATCH 1/3] fix(browser): Mark errors caught from `TryCatch` integration as unhandled --- packages/browser/src/integrations/trycatch.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/browser/src/integrations/trycatch.ts b/packages/browser/src/integrations/trycatch.ts index cb3e42cfd107..0ec05cc552df 100644 --- a/packages/browser/src/integrations/trycatch.ts +++ b/packages/browser/src/integrations/trycatch.ts @@ -113,7 +113,7 @@ function _wrapTimeFunction(original: () => void): () => number { args[0] = wrap(originalCallback, { mechanism: { data: { function: getFunctionName(original) }, - handled: true, + handled: false, type: 'instrument', }, }); @@ -134,7 +134,7 @@ function _wrapRAF(original: any): (callback: () => void) => any { function: 'requestAnimationFrame', handler: getFunctionName(original), }, - handled: true, + handled: false, type: 'instrument', }, }), @@ -160,7 +160,7 @@ function _wrapXHR(originalSend: () => void): () => void { function: prop, handler: getFunctionName(original), }, - handled: true, + handled: false, type: 'instrument', }, }; @@ -220,7 +220,7 @@ function _wrapEventTarget(target: string): void { handler: getFunctionName(fn), target, }, - handled: true, + handled: false, type: 'instrument', }, }); @@ -239,7 +239,7 @@ function _wrapEventTarget(target: string): void { handler: getFunctionName(fn), target, }, - handled: true, + handled: false, type: 'instrument', }, }), From a5aaed9fb8defbd0fffd80cbfd253c602e897e4b Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Tue, 29 Aug 2023 13:21:40 +0200 Subject: [PATCH 2/3] fix tests --- .../suites/public-api/instrumentation/eventListener/test.ts | 2 +- .../suites/sessions/update-session/test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/browser-integration-tests/suites/public-api/instrumentation/eventListener/test.ts b/packages/browser-integration-tests/suites/public-api/instrumentation/eventListener/test.ts index 8d821a14906e..d7b9f75a13f2 100644 --- a/packages/browser-integration-tests/suites/public-api/instrumentation/eventListener/test.ts +++ b/packages/browser-integration-tests/suites/public-api/instrumentation/eventListener/test.ts @@ -17,7 +17,7 @@ sentryTest( value: 'event_listener_error', mechanism: { type: 'instrument', - handled: true, + handled: false, }, stacktrace: { frames: expect.any(Array), diff --git a/packages/browser-integration-tests/suites/sessions/update-session/test.ts b/packages/browser-integration-tests/suites/sessions/update-session/test.ts index 5ce88e4bdc0e..dfde68dce175 100644 --- a/packages/browser-integration-tests/suites/sessions/update-session/test.ts +++ b/packages/browser-integration-tests/suites/sessions/update-session/test.ts @@ -17,7 +17,7 @@ sentryTest('should update session when an error is thrown.', async ({ getLocalTe expect(updatedSession).toBeDefined(); expect(updatedSession.init).toBe(false); expect(updatedSession.errors).toBe(1); - expect(updatedSession.status).toBe('ok'); + expect(updatedSession.status).toBe('crashed'); expect(pageloadSession.sid).toBe(updatedSession.sid); }); From b618a52a37d1520bfa4dd4596ea6278fe5fffa18 Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Tue, 29 Aug 2023 14:32:44 +0200 Subject: [PATCH 3/3] fix old integration tests --- packages/browser/test/integration/suites/builtins.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/browser/test/integration/suites/builtins.js b/packages/browser/test/integration/suites/builtins.js index 8fa30d120e90..7a7760d9f689 100644 --- a/packages/browser/test/integration/suites/builtins.js +++ b/packages/browser/test/integration/suites/builtins.js @@ -182,7 +182,7 @@ describe('wrapped built-ins', function () { assert.deepEqual(summary.events[0].exception.values[0].mechanism, { type: 'instrument', - handled: true, + handled: false, data: { function: 'onreadystatechange', }, @@ -237,7 +237,7 @@ describe('wrapped built-ins', function () { assert.deepEqual(summary.events[0].exception.values[0].mechanism, { type: 'instrument', - handled: true, + handled: false, }); } }); @@ -277,7 +277,7 @@ describe('wrapped built-ins', function () { assert.oneOf(target, ['Node', 'EventTarget']); assert.deepEqual(summary.events[0].exception.values[0].mechanism, { type: 'instrument', - handled: true, + handled: false, data: { function: 'addEventListener', }, @@ -313,7 +313,7 @@ describe('wrapped built-ins', function () { assert.oneOf(target, ['Node', 'EventTarget']); assert.deepEqual(summary.events[0].exception.values[0].mechanism, { type: 'instrument', - handled: true, + handled: false, data: { function: 'addEventListener', handler: '',