From 61454e4c3b2f0a70a1ed25a996d4ce68bb616626 Mon Sep 17 00:00:00 2001 From: Luca Forstner Date: Mon, 27 Mar 2023 13:03:05 +0000 Subject: [PATCH] fix(core): Remove `abs_path` from stack trace (reverting #7167) --- packages/browser/src/stack-parsers.ts | 1 - .../test/unit/tracekit/chromium.test.ts | 367 ++----------- .../test/unit/tracekit/firefox.test.ts | 346 ++---------- .../browser/test/unit/tracekit/ie.test.ts | 74 +-- .../browser/test/unit/tracekit/misc.test.ts | 24 +- .../browser/test/unit/tracekit/opera.test.ts | 149 +----- .../test/unit/tracekit/react-native.test.ts | 495 +++--------------- .../browser/test/unit/tracekit/react.test.ts | 36 +- .../browser/test/unit/tracekit/safari.test.ts | 219 ++------ packages/core/src/utils/prepareEvent.ts | 24 +- packages/core/test/lib/prepareEvent.test.ts | 10 +- .../tests/devErrorSymbolification.test.ts | 1 - packages/nextjs/src/client/index.ts | 13 +- .../devErrorSymbolicationEventProcessor.ts | 2 +- packages/types/src/debugMeta.ts | 2 +- 15 files changed, 231 insertions(+), 1532 deletions(-) diff --git a/packages/browser/src/stack-parsers.ts b/packages/browser/src/stack-parsers.ts index 6419f3660e9d..d8ab27b21f50 100644 --- a/packages/browser/src/stack-parsers.ts +++ b/packages/browser/src/stack-parsers.ts @@ -13,7 +13,6 @@ const GECKO_PRIORITY = 50; function createFrame(filename: string, func: string, lineno?: number, colno?: number): StackFrame { const frame: StackFrame = { filename, - abs_path: filename, // As opposed to filename, abs_path is immutable (I can't control your actions but don't touch it!) function: func, in_app: true, // All browser frames are considered in_app }; diff --git a/packages/browser/test/unit/tracekit/chromium.test.ts b/packages/browser/test/unit/tracekit/chromium.test.ts index 0d600cc28dd1..b0df582ebeef 100644 --- a/packages/browser/test/unit/tracekit/chromium.test.ts +++ b/packages/browser/test/unit/tracekit/chromium.test.ts @@ -9,7 +9,7 @@ describe('Tracekit - Chrome Tests', () => { expect(ex).toEqual({ value: 'foo', type: 'bar', - stacktrace: { frames: [{ filename: 'native', abs_path: 'native', function: 'Array.forEach', in_app: true }] }, + stacktrace: { frames: [{ filename: 'native', function: 'Array.forEach', in_app: true }] }, }); }); @@ -33,38 +33,10 @@ describe('Tracekit - Chrome Tests', () => { type: 'foo', stacktrace: { frames: [ - { - filename: 'http://path/to/file.js', - abs_path: 'http://path/to/file.js', - function: '?', - lineno: 24, - colno: 4, - in_app: true, - }, - { - filename: 'http://path/to/file.js', - abs_path: 'http://path/to/file.js', - function: 'foo', - lineno: 20, - colno: 5, - in_app: true, - }, - { - filename: 'http://path/to/file.js', - abs_path: 'http://path/to/file.js', - function: 'bar', - lineno: 16, - colno: 5, - in_app: true, - }, - { - filename: 'http://path/to/file.js', - abs_path: 'http://path/to/file.js', - function: 'bar', - lineno: 13, - colno: 17, - in_app: true, - }, + { filename: 'http://path/to/file.js', function: '?', lineno: 24, colno: 4, in_app: true }, + { filename: 'http://path/to/file.js', function: 'foo', lineno: 20, colno: 5, in_app: true }, + { filename: 'http://path/to/file.js', function: 'bar', lineno: 16, colno: 5, in_app: true }, + { filename: 'http://path/to/file.js', function: 'bar', lineno: 13, colno: 17, in_app: true }, ], }, }); @@ -90,7 +62,6 @@ describe('Tracekit - Chrome Tests', () => { frames: [ { filename: 'http://localhost:8080/file.js', - abs_path: 'http://localhost:8080/file.js', function: 'I.e.fn.(anonymous function) [as index]', lineno: 10, colno: 3651, @@ -98,7 +69,6 @@ describe('Tracekit - Chrome Tests', () => { }, { filename: 'http://localhost:8080/file.js', - abs_path: 'http://localhost:8080/file.js', function: 'HTMLButtonElement.onclick', lineno: 107, colno: 146, @@ -106,7 +76,6 @@ describe('Tracekit - Chrome Tests', () => { }, { filename: 'http://localhost:8080/file.js', - abs_path: 'http://localhost:8080/file.js', function: 'dumpExceptionError', lineno: 41, colno: 27, @@ -139,7 +108,6 @@ describe('Tracekit - Chrome Tests', () => { frames: [ { filename: 'webpack:///./~/react-proxy/modules/createPrototypeProxy.js?', - abs_path: 'webpack:///./~/react-proxy/modules/createPrototypeProxy.js?', function: 'TESTTESTTEST.proxiedMethod', lineno: 44, colno: 30, @@ -147,7 +115,6 @@ describe('Tracekit - Chrome Tests', () => { }, { filename: 'webpack:///./~/react-transform-catch-errors/lib/index.js?', - abs_path: 'webpack:///./~/react-transform-catch-errors/lib/index.js?', function: 'TESTTESTTEST.tryRender', lineno: 34, colno: 31, @@ -155,7 +122,6 @@ describe('Tracekit - Chrome Tests', () => { }, { filename: 'webpack:///./src/components/test/test.jsx?', - abs_path: 'webpack:///./src/components/test/test.jsx?', function: 'TESTTESTTEST.render', lineno: 272, colno: 32, @@ -163,7 +129,6 @@ describe('Tracekit - Chrome Tests', () => { }, { filename: 'webpack:///./src/components/test/test.jsx?', - abs_path: 'webpack:///./src/components/test/test.jsx?', function: 'TESTTESTTEST.eval', lineno: 295, colno: 108, @@ -194,46 +159,11 @@ describe('Tracekit - Chrome Tests', () => { type: 'Error', stacktrace: { frames: [ - { - filename: 'http://localhost:8080/file.js', - abs_path: 'http://localhost:8080/file.js', - function: '?', - lineno: 31, - colno: 13, - in_app: true, - }, - { - filename: 'http://localhost:8080/file.js', - abs_path: 'http://localhost:8080/file.js', - function: 'Object.speak', - lineno: 21, - colno: 17, - in_app: true, - }, - { - filename: 'http://localhost:8080/file.js', - abs_path: 'http://localhost:8080/file.js', - function: 'eval', - lineno: 21, - colno: 17, - in_app: true, - }, - { - filename: 'http://localhost:8080/file.js', - abs_path: 'http://localhost:8080/file.js', - function: 'foo', - lineno: 21, - colno: 17, - in_app: true, - }, - { - filename: 'http://localhost:8080/file.js', - abs_path: 'http://localhost:8080/file.js', - function: 'baz', - lineno: 21, - colno: 17, - in_app: true, - }, + { filename: 'http://localhost:8080/file.js', function: '?', lineno: 31, colno: 13, in_app: true }, + { filename: 'http://localhost:8080/file.js', function: 'Object.speak', lineno: 21, colno: 17, in_app: true }, + { filename: 'http://localhost:8080/file.js', function: 'eval', lineno: 21, colno: 17, in_app: true }, + { filename: 'http://localhost:8080/file.js', function: 'foo', lineno: 21, colno: 17, in_app: true }, + { filename: 'http://localhost:8080/file.js', function: 'baz', lineno: 21, colno: 17, in_app: true }, ], }, }); @@ -263,7 +193,6 @@ describe('Tracekit - Chrome Tests', () => { frames: [ { filename: 'blob:http%3A//localhost%3A8080/abfc40e9-4742-44ed-9dcd-af8f99a29379', - abs_path: 'blob:http%3A//localhost%3A8080/abfc40e9-4742-44ed-9dcd-af8f99a29379', function: 'n.handle', lineno: 7, colno: 2863, @@ -271,7 +200,6 @@ describe('Tracekit - Chrome Tests', () => { }, { filename: 'blob:http%3A//localhost%3A8080/abfc40e9-4742-44ed-9dcd-af8f99a29379', - abs_path: 'blob:http%3A//localhost%3A8080/abfc40e9-4742-44ed-9dcd-af8f99a29379', function: 'n.fire', lineno: 7, colno: 3019, @@ -279,7 +207,6 @@ describe('Tracekit - Chrome Tests', () => { }, { filename: 'blob:http%3A//localhost%3A8080/abfc40e9-4742-44ed-9dcd-af8f99a29379', - abs_path: 'blob:http%3A//localhost%3A8080/abfc40e9-4742-44ed-9dcd-af8f99a29379', function: '?', lineno: 1, colno: 6911, @@ -287,7 +214,6 @@ describe('Tracekit - Chrome Tests', () => { }, { filename: 'blob:http%3A//localhost%3A8080/d4eefe0f-361a-4682-b217-76587d9f712a', - abs_path: 'blob:http%3A//localhost%3A8080/d4eefe0f-361a-4682-b217-76587d9f712a', function: '?', lineno: 15, colno: 10978, @@ -295,7 +221,6 @@ describe('Tracekit - Chrome Tests', () => { }, { filename: 'blob:http%3A//localhost%3A8080/abfc40e9-4742-44ed-9dcd-af8f99a29379', - abs_path: 'blob:http%3A//localhost%3A8080/abfc40e9-4742-44ed-9dcd-af8f99a29379', function: 'Object.d [as add]', lineno: 31, colno: 30039, @@ -303,13 +228,12 @@ describe('Tracekit - Chrome Tests', () => { }, { filename: 'blob:http%3A//localhost%3A8080/abfc40e9-4742-44ed-9dcd-af8f99a29379', - abs_path: 'blob:http%3A//localhost%3A8080/abfc40e9-4742-44ed-9dcd-af8f99a29379', function: 's', lineno: 31, colno: 29146, in_app: true, }, - { filename: 'native', abs_path: 'native', function: 'Error', in_app: true }, + { filename: 'native', function: 'Error', in_app: true }, ], }, }); @@ -332,7 +256,6 @@ describe('Tracekit - Chrome Tests', () => { frames: [ { filename: 'examplescheme://examplehost/cd351f7250857e22ceaa.worker.js', - abs_path: 'examplescheme://examplehost/cd351f7250857e22ceaa.worker.js', function: '?', lineno: 70179, colno: 15, @@ -361,31 +284,10 @@ describe('Tracekit - Chrome Tests', () => { type: 'Error', stacktrace: { frames: [ - { - filename: 'http://localhost:5000/test', - abs_path: 'http://localhost:5000/test', - function: '?', - lineno: 24, - colno: 7, - in_app: true, - }, - { - filename: 'http://localhost:5000/test', - abs_path: 'http://localhost:5000/test', - function: 'foo', - lineno: 19, - colno: 19, - in_app: true, - }, - { filename: '', abs_path: '', function: 'Array.map', in_app: true }, - { - filename: 'http://localhost:5000/test', - abs_path: 'http://localhost:5000/test', - function: 'fooIterator', - lineno: 20, - colno: 17, - in_app: true, - }, + { filename: 'http://localhost:5000/test', function: '?', lineno: 24, colno: 7, in_app: true }, + { filename: 'http://localhost:5000/test', function: 'foo', lineno: 19, colno: 19, in_app: true }, + { filename: '', function: 'Array.map', in_app: true }, + { filename: 'http://localhost:5000/test', function: 'fooIterator', lineno: 20, colno: 17, in_app: true }, ], }, }); @@ -415,79 +317,16 @@ describe('Tracekit - Chrome Tests', () => { type: 'Error', stacktrace: { frames: [ - { - filename: 'http://localhost:5000/', - abs_path: 'http://localhost:5000/', - function: '?', - lineno: 50, - colno: 19, - in_app: true, - }, - { - filename: 'http://localhost:5000/', - abs_path: 'http://localhost:5000/', - function: 'Foo.testMethod', - lineno: 44, - colno: 7, - in_app: true, - }, - { - filename: 'http://localhost:5000/', - abs_path: 'http://localhost:5000/', - function: 'aha', - lineno: 39, - colno: 5, - in_app: true, - }, - { - filename: 'http://localhost:5000/', - abs_path: 'http://localhost:5000/', - function: 'eval', - lineno: 37, - colno: 5, - in_app: true, - }, - { - filename: 'http://localhost:5000/', - abs_path: 'http://localhost:5000/', - function: 'test', - lineno: 33, - colno: 23, - in_app: true, - }, - { filename: '', abs_path: '', function: 'Array.map', in_app: true }, - { - filename: 'http://localhost:5000/', - abs_path: 'http://localhost:5000/', - function: '?', - lineno: 34, - colno: 17, - in_app: true, - }, - { - filename: 'http://localhost:5000/', - abs_path: 'http://localhost:5000/', - function: 'Object.callback', - lineno: 25, - colno: 7, - in_app: true, - }, - { - filename: 'http://localhost:5000/', - abs_path: 'http://localhost:5000/', - function: 'callAnotherThing', - lineno: 20, - colno: 16, - in_app: true, - }, - { - filename: 'http://localhost:5000/', - abs_path: 'http://localhost:5000/', - function: 'Object.aha', - lineno: 19, - colno: 13, - in_app: true, - }, + { filename: 'http://localhost:5000/', function: '?', lineno: 50, colno: 19, in_app: true }, + { filename: 'http://localhost:5000/', function: 'Foo.testMethod', lineno: 44, colno: 7, in_app: true }, + { filename: 'http://localhost:5000/', function: 'aha', lineno: 39, colno: 5, in_app: true }, + { filename: 'http://localhost:5000/', function: 'eval', lineno: 37, colno: 5, in_app: true }, + { filename: 'http://localhost:5000/', function: 'test', lineno: 33, colno: 23, in_app: true }, + { filename: '', function: 'Array.map', in_app: true }, + { filename: 'http://localhost:5000/', function: '?', lineno: 34, colno: 17, in_app: true }, + { filename: 'http://localhost:5000/', function: 'Object.callback', lineno: 25, colno: 7, in_app: true }, + { filename: 'http://localhost:5000/', function: 'callAnotherThing', lineno: 20, colno: 16, in_app: true }, + { filename: 'http://localhost:5000/', function: 'Object.aha', lineno: 19, colno: 13, in_app: true }, ], }, }); @@ -510,30 +349,9 @@ describe('Tracekit - Chrome Tests', () => { type: 'Error', stacktrace: { frames: [ - { - filename: 'http://localhost:5000/', - abs_path: 'http://localhost:5000/', - function: 'test', - lineno: 33, - colno: 23, - in_app: true, - }, - { - filename: 'http://localhost:5000/', - abs_path: 'http://localhost:5000/', - function: 'Object.callback', - lineno: 25, - colno: 7, - in_app: true, - }, - { - filename: 'http://localhost:5000/', - abs_path: 'http://localhost:5000/', - function: 'callAnotherThing', - lineno: 20, - colno: 16, - in_app: true, - }, + { filename: 'http://localhost:5000/', function: 'test', lineno: 33, colno: 23, in_app: true }, + { filename: 'http://localhost:5000/', function: 'Object.callback', lineno: 25, colno: 7, in_app: true }, + { filename: 'http://localhost:5000/', function: 'callAnotherThing', lineno: 20, colno: 16, in_app: true }, ], }, }); @@ -557,31 +375,10 @@ describe('Tracekit - Chrome Tests', () => { type: 'Error', stacktrace: { frames: [ - { - filename: 'http://localhost:5000/test', - abs_path: 'http://localhost:5000/test', - function: 'Global code', - lineno: 24, - colno: 7, - in_app: true, - }, - { - filename: 'http://localhost:5000/test', - abs_path: 'http://localhost:5000/test', - function: 'foo', - lineno: 19, - colno: 9, - in_app: true, - }, - { filename: 'native code', abs_path: 'native code', function: 'Array.prototype.map', in_app: true }, - { - filename: 'http://localhost:5000/test', - abs_path: 'http://localhost:5000/test', - function: 'fooIterator', - lineno: 20, - colno: 11, - in_app: true, - }, + { filename: 'http://localhost:5000/test', function: 'Global code', lineno: 24, colno: 7, in_app: true }, + { filename: 'http://localhost:5000/test', function: 'foo', lineno: 19, colno: 9, in_app: true }, + { filename: 'native code', function: 'Array.prototype.map', in_app: true }, + { filename: 'http://localhost:5000/test', function: 'fooIterator', lineno: 20, colno: 11, in_app: true }, ], }, }); @@ -611,72 +408,22 @@ describe('Tracekit - Chrome Tests', () => { type: 'Error', stacktrace: { frames: [ + { filename: 'http://localhost:5000/', function: 'Anonymous function', lineno: 50, colno: 8, in_app: true }, { filename: 'http://localhost:5000/', - abs_path: 'http://localhost:5000/', - function: 'Anonymous function', - lineno: 50, - colno: 8, - in_app: true, - }, - { - filename: 'http://localhost:5000/', - abs_path: 'http://localhost:5000/', function: 'Foo.prototype.testMethod', lineno: 44, colno: 7, in_app: true, }, - { - filename: 'http://localhost:5000/', - abs_path: 'http://localhost:5000/', - function: 'aha', - lineno: 39, - colno: 5, - in_app: true, - }, - { filename: 'eval code', abs_path: 'eval code', function: 'eval code', lineno: 1, colno: 1, in_app: true }, - { - filename: 'http://localhost:5000/', - abs_path: 'http://localhost:5000/', - function: 'test', - lineno: 33, - colno: 5, - in_app: true, - }, - { filename: 'native code', abs_path: 'native code', function: 'Array.prototype.map', in_app: true }, - { - filename: 'http://localhost:5000/', - abs_path: 'http://localhost:5000/', - function: 'Anonymous function', - lineno: 34, - colno: 7, - in_app: true, - }, - { - filename: 'http://localhost:5000/', - abs_path: 'http://localhost:5000/', - function: 'callback', - lineno: 25, - colno: 7, - in_app: true, - }, - { - filename: 'http://localhost:5000/', - abs_path: 'http://localhost:5000/', - function: 'callAnotherThing', - lineno: 18, - colno: 6, - in_app: true, - }, - { - filename: 'http://localhost:5000/', - abs_path: 'http://localhost:5000/', - function: 'aha', - lineno: 19, - colno: 7, - in_app: true, - }, + { filename: 'http://localhost:5000/', function: 'aha', lineno: 39, colno: 5, in_app: true }, + { filename: 'eval code', function: 'eval code', lineno: 1, colno: 1, in_app: true }, + { filename: 'http://localhost:5000/', function: 'test', lineno: 33, colno: 5, in_app: true }, + { filename: 'native code', function: 'Array.prototype.map', in_app: true }, + { filename: 'http://localhost:5000/', function: 'Anonymous function', lineno: 34, colno: 7, in_app: true }, + { filename: 'http://localhost:5000/', function: 'callback', lineno: 25, colno: 7, in_app: true }, + { filename: 'http://localhost:5000/', function: 'callAnotherThing', lineno: 18, colno: 6, in_app: true }, + { filename: 'http://localhost:5000/', function: 'aha', lineno: 19, colno: 7, in_app: true }, ], }, }); @@ -699,7 +446,6 @@ describe('Tracekit - Chrome Tests', () => { frames: [ { filename: 'C:\\Users\\user\\path\\to\\file.js', - abs_path: 'C:\\Users\\user\\path\\to\\file.js', function: 'TESTTESTTEST.someMethod', lineno: 295, colno: 108, @@ -732,7 +478,6 @@ describe('Tracekit - Chrome Tests', () => { frames: [ { filename: 'react-dom.development.js?f8c1', - abs_path: 'react-dom.development.js?f8c1', function: 'commitLayoutEffects', in_app: true, lineno: 23426, @@ -740,7 +485,6 @@ describe('Tracekit - Chrome Tests', () => { }, { filename: 'react-dom.development.js?f8c1', - abs_path: 'react-dom.development.js?f8c1', function: 'commitLifeCycles', in_app: true, lineno: 20663, @@ -748,7 +492,6 @@ describe('Tracekit - Chrome Tests', () => { }, { filename: 'genericDiscoverQuery.tsx?33f8', - abs_path: 'genericDiscoverQuery.tsx?33f8', function: '_GenericDiscoverQuery.componentDidMount', in_app: true, lineno: 152, @@ -756,7 +499,6 @@ describe('Tracekit - Chrome Tests', () => { }, { filename: 'genericDiscoverQuery.tsx?33f8', - abs_path: 'genericDiscoverQuery.tsx?33f8', function: '_GenericDiscoverQuery.eval [as fetchData]', in_app: true, lineno: 256, @@ -764,7 +506,6 @@ describe('Tracekit - Chrome Tests', () => { }, { filename: 'genericDiscoverQuery.tsx?33f8', - abs_path: 'genericDiscoverQuery.tsx?33f8', function: 'doDiscoverQuery', in_app: true, lineno: 328, @@ -772,7 +513,6 @@ describe('Tracekit - Chrome Tests', () => { }, { filename: 'api.tsx', - abs_path: 'api.tsx', function: 'Client.requestPromise', in_app: true, lineno: 554, @@ -802,10 +542,9 @@ describe('Tracekit - Chrome Tests', () => { type: 'ChunkLoadError', stacktrace: { frames: [ - { filename: '', abs_path: '', function: 'Array.reduce', in_app: true }, + { filename: '', function: 'Array.reduce', in_app: true }, { filename: 'webpack/runtime/ensure chunk', - abs_path: 'webpack/runtime/ensure chunk', function: '?', in_app: true, lineno: 6, @@ -813,7 +552,6 @@ describe('Tracekit - Chrome Tests', () => { }, { filename: 'webpack/runtime/jsonp chunk loading', - abs_path: 'webpack/runtime/jsonp chunk loading', function: 'key', in_app: true, lineno: 27, @@ -821,15 +559,12 @@ describe('Tracekit - Chrome Tests', () => { }, { filename: '/_static/dist/sentry/chunks/app_bootstrap_initializeLocale_tsx.abcdefg.js', - abs_path: '/_static/dist/sentry/chunks/app_bootstrap_initializeLocale_tsx.abcdefg.js', function: '?', in_app: true, }, { filename: 'https://s1.sentry-cdn.com/_static/dist/sentry/chunks/app_bootstrap_initializeLocale_tsx.abcdefg.js', - abs_path: - 'https://s1.sentry-cdn.com/_static/dist/sentry/chunks/app_bootstrap_initializeLocale_tsx.abcdefg.js', function: '?', in_app: true, }, @@ -857,22 +592,8 @@ describe('Tracekit - Chrome Tests', () => { type: 'Error', stacktrace: { frames: [ - { - filename: 'http://localhost:5000/', - abs_path: 'http://localhost:5000/', - function: '?', - lineno: 50, - colno: 19, - in_app: true, - }, - { - filename: 'http://localhost:5000/', - abs_path: 'http://localhost:5000/', - function: 'aha', - lineno: 39, - colno: 5, - in_app: true, - }, + { filename: 'http://localhost:5000/', function: '?', lineno: 50, colno: 19, in_app: true }, + { filename: 'http://localhost:5000/', function: 'aha', lineno: 39, colno: 5, in_app: true }, ], }, }); diff --git a/packages/browser/test/unit/tracekit/firefox.test.ts b/packages/browser/test/unit/tracekit/firefox.test.ts index 9a062d0a123b..f75dd7ccf010 100644 --- a/packages/browser/test/unit/tracekit/firefox.test.ts +++ b/packages/browser/test/unit/tracekit/firefox.test.ts @@ -26,55 +26,13 @@ describe('Tracekit - Firefox Tests', () => { type: 'TypeError', stacktrace: { frames: [ - { - filename: 'http://127.0.0.1:8000/js/file.js', - abs_path: 'http://127.0.0.1:8000/js/file.js', - function: '?', - lineno: 24, - in_app: true, - }, - { - filename: 'http://127.0.0.1:8000/js/file.js', - abs_path: 'http://127.0.0.1:8000/js/file.js', - function: 'foo', - lineno: 20, - in_app: true, - }, - { - filename: 'http://127.0.0.1:8000/js/file.js', - abs_path: 'http://127.0.0.1:8000/js/file.js', - function: 'bar', - lineno: 16, - in_app: true, - }, - { - filename: 'http://127.0.0.1:8000/js/file.js', - abs_path: 'http://127.0.0.1:8000/js/file.js', - function: 'bar', - lineno: 13, - in_app: true, - }, - { - filename: 'http://127.0.0.1:8000/js/stacktrace.js', - abs_path: 'http://127.0.0.1:8000/js/stacktrace.js', - function: 'printStackTrace', - lineno: 18, - in_app: true, - }, - { - filename: 'http://127.0.0.1:8000/js/stacktrace.js', - abs_path: 'http://127.0.0.1:8000/js/stacktrace.js', - function: '?', - lineno: 31, - in_app: true, - }, - { - filename: 'http://127.0.0.1:8000/js/stacktrace.js', - abs_path: 'http://127.0.0.1:8000/js/stacktrace.js', - function: '?', - lineno: 44, - in_app: true, - }, + { filename: 'http://127.0.0.1:8000/js/file.js', function: '?', lineno: 24, in_app: true }, + { filename: 'http://127.0.0.1:8000/js/file.js', function: 'foo', lineno: 20, in_app: true }, + { filename: 'http://127.0.0.1:8000/js/file.js', function: 'bar', lineno: 16, in_app: true }, + { filename: 'http://127.0.0.1:8000/js/file.js', function: 'bar', lineno: 13, in_app: true }, + { filename: 'http://127.0.0.1:8000/js/stacktrace.js', function: 'printStackTrace', lineno: 18, in_app: true }, + { filename: 'http://127.0.0.1:8000/js/stacktrace.js', function: '?', lineno: 31, in_app: true }, + { filename: 'http://127.0.0.1:8000/js/stacktrace.js', function: '?', lineno: 44, in_app: true }, ], }, }); @@ -104,55 +62,13 @@ describe('Tracekit - Firefox Tests', () => { type: 'foo', stacktrace: { frames: [ - { - filename: 'file:///G:/js/file.js', - abs_path: 'file:///G:/js/file.js', - function: '?', - lineno: 24, - in_app: true, - }, - { - filename: 'file:///G:/js/file.js', - abs_path: 'file:///G:/js/file.js', - function: 'foo', - lineno: 20, - in_app: true, - }, - { - filename: 'file:///G:/js/file.js', - abs_path: 'file:///G:/js/file.js', - function: 'bar', - lineno: 16, - in_app: true, - }, - { - filename: 'file:///G:/js/file.js', - abs_path: 'file:///G:/js/file.js', - function: 'bar', - lineno: 13, - in_app: true, - }, - { - filename: 'file:///G:/js/stacktrace.js', - abs_path: 'file:///G:/js/stacktrace.js', - function: 'printStackTrace', - lineno: 18, - in_app: true, - }, - { - filename: 'file:///G:/js/stacktrace.js', - abs_path: 'file:///G:/js/stacktrace.js', - function: '?', - lineno: 31, - in_app: true, - }, - { - filename: 'file:///G:/js/stacktrace.js', - abs_path: 'file:///G:/js/stacktrace.js', - function: '?', - lineno: 44, - in_app: true, - }, + { filename: 'file:///G:/js/file.js', function: '?', lineno: 24, in_app: true }, + { filename: 'file:///G:/js/file.js', function: 'foo', lineno: 20, in_app: true }, + { filename: 'file:///G:/js/file.js', function: 'bar', lineno: 16, in_app: true }, + { filename: 'file:///G:/js/file.js', function: 'bar', lineno: 13, in_app: true }, + { filename: 'file:///G:/js/stacktrace.js', function: 'printStackTrace', lineno: 18, in_app: true }, + { filename: 'file:///G:/js/stacktrace.js', function: '?', lineno: 31, in_app: true }, + { filename: 'file:///G:/js/stacktrace.js', function: '?', lineno: 44, in_app: true }, ], }, }); @@ -178,27 +94,9 @@ describe('Tracekit - Firefox Tests', () => { type: 'foo', stacktrace: { frames: [ - { - filename: 'http://path/to/file.js', - abs_path: 'http://path/to/file.js', - function: 'onclick', - lineno: 1, - in_app: true, - }, - { - filename: 'http://path/to/file.js', - abs_path: 'http://path/to/file.js', - function: 'dumpException3', - lineno: 52, - in_app: true, - }, - { - filename: 'http://path/to/file.js', - abs_path: 'http://path/to/file.js', - function: '?', - lineno: 48, - in_app: true, - }, + { filename: 'http://path/to/file.js', function: 'onclick', lineno: 1, in_app: true }, + { filename: 'http://path/to/file.js', function: 'dumpException3', lineno: 52, in_app: true }, + { filename: 'http://path/to/file.js', function: '?', lineno: 48, in_app: true }, ], }, }); @@ -225,30 +123,9 @@ describe('Tracekit - Firefox Tests', () => { type: 'Error', stacktrace: { frames: [ - { - filename: 'http://path/to/file.js', - abs_path: 'http://path/to/file.js', - function: '.plugin/e.fn[c]/<', - lineno: 1, - colno: 1, - in_app: true, - }, - { - filename: 'http://path/to/file.js', - abs_path: 'http://path/to/file.js', - function: 'bar', - lineno: 1, - colno: 1, - in_app: true, - }, - { - filename: 'http://path/to/file.js', - abs_path: 'http://path/to/file.js', - function: 'foo', - lineno: 41, - colno: 13, - in_app: true, - }, + { filename: 'http://path/to/file.js', function: '.plugin/e.fn[c]/<', lineno: 1, colno: 1, in_app: true }, + { filename: 'http://path/to/file.js', function: 'bar', lineno: 1, colno: 1, in_app: true }, + { filename: 'http://path/to/file.js', function: 'foo', lineno: 41, colno: 13, in_app: true }, ], }, }); @@ -281,33 +158,11 @@ describe('Tracekit - Firefox Tests', () => { type: 'NS_ERROR_FAILURE', stacktrace: { frames: [ - { - filename: 'file:///path/to/index.html', - abs_path: 'file:///path/to/index.html', - function: '?', - lineno: 23, - colno: 1, - in_app: true, - }, - { - filename: 'file:///path/to/file.js', - abs_path: 'file:///path/to/file.js', - function: 'bar', - lineno: 20, - colno: 3, - in_app: true, - }, - { - filename: 'file:///path/to/file.js', - abs_path: 'file:///path/to/file.js', - function: 'App.prototype.foo', - lineno: 15, - colno: 2, - in_app: true, - }, + { filename: 'file:///path/to/index.html', function: '?', lineno: 23, colno: 1, in_app: true }, + { filename: 'file:///path/to/file.js', function: 'bar', lineno: 20, colno: 3, in_app: true }, + { filename: 'file:///path/to/file.js', function: 'App.prototype.foo', lineno: 15, colno: 2, in_app: true }, { filename: 'http://path/to/file.js', - abs_path: 'http://path/to/file.js', function: '[2] { frames: [ { filename: 'resource://path/data/content/bundle.js', - abs_path: 'resource://path/data/content/bundle.js', function: 'wrapped', lineno: 7270, colno: 25, @@ -348,7 +202,6 @@ describe('Tracekit - Firefox Tests', () => { }, { filename: 'resource://path/data/content/vendor.bundle.js', - abs_path: 'resource://path/data/content/vendor.bundle.js', function: 'dispatchEvent', lineno: 18, colno: 23028, @@ -356,7 +209,6 @@ describe('Tracekit - Firefox Tests', () => { }, { filename: 'resource://path/data/content/bundle.js', - abs_path: 'resource://path/data/content/bundle.js', function: 'render', lineno: 5529, colno: 16, @@ -389,43 +241,11 @@ describe('Tracekit - Firefox Tests', () => { type: 'foo', stacktrace: { frames: [ - { - filename: 'http://localhost:8080/file.js', - abs_path: 'http://localhost:8080/file.js', - function: '?', - lineno: 33, - colno: 9, - in_app: true, - }, - { - filename: 'http://localhost:8080/file.js', - abs_path: 'http://localhost:8080/file.js', - function: 'speak', - lineno: 26, - colno: 17, - in_app: true, - }, - { - filename: 'http://localhost:8080/file.js', - abs_path: 'http://localhost:8080/file.js', - function: 'eval', - lineno: 26, - in_app: true, - }, - { - filename: 'http://localhost:8080/file.js', - abs_path: 'http://localhost:8080/file.js', - function: 'foo', - lineno: 26, - in_app: true, - }, - { - filename: 'http://localhost:8080/file.js', - abs_path: 'http://localhost:8080/file.js', - function: 'baz', - lineno: 26, - in_app: true, - }, + { filename: 'http://localhost:8080/file.js', function: '?', lineno: 33, colno: 9, in_app: true }, + { filename: 'http://localhost:8080/file.js', function: 'speak', lineno: 26, colno: 17, in_app: true }, + { filename: 'http://localhost:8080/file.js', function: 'eval', lineno: 26, in_app: true }, + { filename: 'http://localhost:8080/file.js', function: 'foo', lineno: 26, in_app: true }, + { filename: 'http://localhost:8080/file.js', function: 'baz', lineno: 26, in_app: true }, ], }, }); @@ -447,30 +267,9 @@ describe('Tracekit - Firefox Tests', () => { type: 'Error', stacktrace: { frames: [ - { - filename: 'http://localhost:5000/test', - abs_path: 'http://localhost:5000/test', - function: '?', - lineno: 24, - colno: 7, - in_app: true, - }, - { - filename: 'http://localhost:5000/test', - abs_path: 'http://localhost:5000/test', - function: 'foo', - lineno: 19, - colno: 19, - in_app: true, - }, - { - filename: 'http://localhost:5000/test', - abs_path: 'http://localhost:5000/test', - function: 'fooIterator', - lineno: 20, - colno: 17, - in_app: true, - }, + { filename: 'http://localhost:5000/test', function: '?', lineno: 24, colno: 7, in_app: true }, + { filename: 'http://localhost:5000/test', function: 'foo', lineno: 19, colno: 19, in_app: true }, + { filename: 'http://localhost:5000/test', function: 'fooIterator', lineno: 20, colno: 17, in_app: true }, ], }, }); @@ -498,77 +297,15 @@ describe('Tracekit - Firefox Tests', () => { type: 'Error', stacktrace: { frames: [ - { - filename: 'http://localhost:5000/', - abs_path: 'http://localhost:5000/', - function: '?', - lineno: 50, - colno: 19, - in_app: true, - }, - { - filename: 'http://localhost:5000/', - abs_path: 'http://localhost:5000/', - function: 'testMethod', - lineno: 44, - colno: 7, - in_app: true, - }, - { - filename: 'http://localhost:5000/', - abs_path: 'http://localhost:5000/', - function: 'aha', - lineno: 39, - colno: 5, - in_app: true, - }, - { - filename: 'http://localhost:5000/', - abs_path: 'http://localhost:5000/', - function: 'eval', - lineno: 39, - in_app: true, - }, - { - filename: 'http://localhost:5000/', - abs_path: 'http://localhost:5000/', - function: 'test', - lineno: 33, - colno: 23, - in_app: true, - }, - { - filename: 'http://localhost:5000/', - abs_path: 'http://localhost:5000/', - function: 'test/<', - lineno: 34, - colno: 7, - in_app: true, - }, - { - filename: 'http://localhost:5000/', - abs_path: 'http://localhost:5000/', - function: 'callback', - lineno: 25, - colno: 7, - in_app: true, - }, - { - filename: 'http://localhost:5000/', - abs_path: 'http://localhost:5000/', - function: 'callAnotherThing', - lineno: 20, - colno: 15, - in_app: true, - }, - { - filename: 'http://localhost:5000/', - abs_path: 'http://localhost:5000/', - function: 'aha', - lineno: 19, - colno: 13, - in_app: true, - }, + { filename: 'http://localhost:5000/', function: '?', lineno: 50, colno: 19, in_app: true }, + { filename: 'http://localhost:5000/', function: 'testMethod', lineno: 44, colno: 7, in_app: true }, + { filename: 'http://localhost:5000/', function: 'aha', lineno: 39, colno: 5, in_app: true }, + { filename: 'http://localhost:5000/', function: 'eval', lineno: 39, in_app: true }, + { filename: 'http://localhost:5000/', function: 'test', lineno: 33, colno: 23, in_app: true }, + { filename: 'http://localhost:5000/', function: 'test/<', lineno: 34, colno: 7, in_app: true }, + { filename: 'http://localhost:5000/', function: 'callback', lineno: 25, colno: 7, in_app: true }, + { filename: 'http://localhost:5000/', function: 'callAnotherThing', lineno: 20, colno: 15, in_app: true }, + { filename: 'http://localhost:5000/', function: 'aha', lineno: 19, colno: 13, in_app: true }, ], }, }); @@ -595,7 +332,6 @@ describe('Tracekit - Firefox Tests', () => { { colno: 1018410, filename: 'https://www.random_website.com/main.4a4119c3cdfd10266d84.js', - abs_path: 'https://www.random_website.com/main.4a4119c3cdfd10266d84.js', function: 'handleProfileResult', in_app: true, lineno: 146, @@ -603,7 +339,6 @@ describe('Tracekit - Firefox Tests', () => { { colno: 333807, filename: 'https://www.random_website.com/vendor.d1cae9cfc9917df88de7.js', - abs_path: 'https://www.random_website.com/vendor.d1cae9cfc9917df88de7.js', function: 'detectChanges', in_app: true, lineno: 1, @@ -611,7 +346,6 @@ describe('Tracekit - Firefox Tests', () => { { colno: 296021, filename: 'https://www.random_website.com/vendor.d1cae9cfc9917df88de7.js', - abs_path: 'https://www.random_website.com/vendor.d1cae9cfc9917df88de7.js', function: 'us', in_app: true, lineno: 1, diff --git a/packages/browser/test/unit/tracekit/ie.test.ts b/packages/browser/test/unit/tracekit/ie.test.ts index 6417a7043c32..544542b0dcaf 100644 --- a/packages/browser/test/unit/tracekit/ie.test.ts +++ b/packages/browser/test/unit/tracekit/ie.test.ts @@ -23,30 +23,9 @@ describe('Tracekit - IE Tests', () => { type: 'foo', stacktrace: { frames: [ - { - filename: 'http://path/to/file.js', - abs_path: 'http://path/to/file.js', - function: 'bar', - lineno: 82, - colno: 1, - in_app: true, - }, - { - filename: 'http://path/to/file.js', - abs_path: 'http://path/to/file.js', - function: 'foo', - lineno: 46, - colno: 9, - in_app: true, - }, - { - filename: 'http://path/to/file.js', - abs_path: 'http://path/to/file.js', - function: 'Anonymous function', - lineno: 48, - colno: 13, - in_app: true, - }, + { filename: 'http://path/to/file.js', function: 'bar', lineno: 82, colno: 1, in_app: true }, + { filename: 'http://path/to/file.js', function: 'foo', lineno: 46, colno: 9, in_app: true }, + { filename: 'http://path/to/file.js', function: 'Anonymous function', lineno: 48, colno: 13, in_app: true }, ], }, }); @@ -73,30 +52,9 @@ describe('Tracekit - IE Tests', () => { type: 'TypeError', stacktrace: { frames: [ - { - filename: 'http://path/to/file.js', - abs_path: 'http://path/to/file.js', - function: 'bar', - lineno: 108, - colno: 1, - in_app: true, - }, - { - filename: 'http://path/to/file.js', - abs_path: 'http://path/to/file.js', - function: 'foo', - lineno: 45, - colno: 13, - in_app: true, - }, - { - filename: 'http://path/to/file.js', - abs_path: 'http://path/to/file.js', - function: 'Anonymous function', - lineno: 47, - colno: 21, - in_app: true, - }, + { filename: 'http://path/to/file.js', function: 'bar', lineno: 108, colno: 1, in_app: true }, + { filename: 'http://path/to/file.js', function: 'foo', lineno: 45, colno: 13, in_app: true }, + { filename: 'http://path/to/file.js', function: 'Anonymous function', lineno: 47, colno: 21, in_app: true }, ], }, }); @@ -122,23 +80,9 @@ describe('Tracekit - IE Tests', () => { type: 'ReferenceError', stacktrace: { frames: [ - { - filename: 'http://path/to/file.js', - abs_path: 'http://path/to/file.js', - function: 'bar', - lineno: 109, - colno: 1, - in_app: true, - }, - { - filename: 'http://path/to/file.js', - abs_path: 'http://path/to/file.js', - function: 'foo', - lineno: 58, - colno: 17, - in_app: true, - }, - { filename: 'eval code', abs_path: 'eval code', function: 'eval code', lineno: 1, colno: 1, in_app: true }, + { filename: 'http://path/to/file.js', function: 'bar', lineno: 109, colno: 1, in_app: true }, + { filename: 'http://path/to/file.js', function: 'foo', lineno: 58, colno: 17, in_app: true }, + { filename: 'eval code', function: 'eval code', lineno: 1, colno: 1, in_app: true }, ], }, }); diff --git a/packages/browser/test/unit/tracekit/misc.test.ts b/packages/browser/test/unit/tracekit/misc.test.ts index dbe718c9410f..e9db457ea196 100644 --- a/packages/browser/test/unit/tracekit/misc.test.ts +++ b/packages/browser/test/unit/tracekit/misc.test.ts @@ -19,27 +19,9 @@ describe('Tracekit - Misc Tests', () => { type: 'foo', stacktrace: { frames: [ - { - filename: 'http://path/to/file.js', - abs_path: 'http://path/to/file.js', - function: '?', - lineno: 4287, - in_app: true, - }, - { - filename: 'http://path/to/file.js', - abs_path: 'http://path/to/file.js', - function: 'foo', - lineno: 4283, - in_app: true, - }, - { - filename: 'file:///path/to/file.js', - abs_path: 'file:///path/to/file.js', - function: '?', - lineno: 878, - in_app: true, - }, + { filename: 'http://path/to/file.js', function: '?', lineno: 4287, in_app: true }, + { filename: 'http://path/to/file.js', function: 'foo', lineno: 4283, in_app: true }, + { filename: 'file:///path/to/file.js', function: '?', lineno: 878, in_app: true }, ], }, }); diff --git a/packages/browser/test/unit/tracekit/opera.test.ts b/packages/browser/test/unit/tracekit/opera.test.ts index 08d7119fb5bb..e86855dc172a 100644 --- a/packages/browser/test/unit/tracekit/opera.test.ts +++ b/packages/browser/test/unit/tracekit/opera.test.ts @@ -37,55 +37,13 @@ describe('Tracekit - Opera Tests', () => { type: 'foo', stacktrace: { frames: [ - { - filename: 'http://path/to/file.js', - abs_path: 'http://path/to/file.js', - function: '?', - lineno: 15, - in_app: true, - }, - { - filename: 'http://path/to/file.js', - abs_path: 'http://path/to/file.js', - function: 'foo', - lineno: 11, - in_app: true, - }, - { - filename: 'http://path/to/file.js', - abs_path: 'http://path/to/file.js', - function: 'bar', - lineno: 7, - in_app: true, - }, - { - filename: 'http://path/to/file.js', - abs_path: 'http://path/to/file.js', - function: 'bar', - lineno: 4, - in_app: true, - }, - { - filename: 'http://path/to/file.js', - abs_path: 'http://path/to/file.js', - function: 'printStackTrace', - lineno: 18, - in_app: true, - }, - { - filename: 'http://path/to/file.js', - abs_path: 'http://path/to/file.js', - function: '?', - lineno: 27, - in_app: true, - }, - { - filename: 'http://path/to/file.js', - abs_path: 'http://path/to/file.js', - function: '?', - lineno: 42, - in_app: true, - }, + { filename: 'http://path/to/file.js', function: '?', lineno: 15, in_app: true }, + { filename: 'http://path/to/file.js', function: 'foo', lineno: 11, in_app: true }, + { filename: 'http://path/to/file.js', function: 'bar', lineno: 7, in_app: true }, + { filename: 'http://path/to/file.js', function: 'bar', lineno: 4, in_app: true }, + { filename: 'http://path/to/file.js', function: 'printStackTrace', lineno: 18, in_app: true }, + { filename: 'http://path/to/file.js', function: '?', lineno: 27, in_app: true }, + { filename: 'http://path/to/file.js', function: '?', lineno: 42, in_app: true }, ], }, }); @@ -125,62 +83,13 @@ describe('Tracekit - Opera Tests', () => { type: 'foo', stacktrace: { frames: [ - { - filename: 'http://path/to/file.js', - abs_path: 'http://path/to/file.js', - function: '?', - lineno: 15, - colno: 3, - in_app: true, - }, - { - filename: 'http://path/to/file.js', - abs_path: 'http://path/to/file.js', - function: 'foo', - lineno: 11, - colno: 4, - in_app: true, - }, - { - filename: 'http://path/to/file.js', - abs_path: 'http://path/to/file.js', - function: 'bar', - lineno: 7, - colno: 4, - in_app: true, - }, - { - filename: 'http://path/to/file.js', - abs_path: 'http://path/to/file.js', - function: 'bar', - lineno: 4, - colno: 5, - in_app: true, - }, - { - filename: 'http://path/to/file.js', - abs_path: 'http://path/to/file.js', - function: 'printStackTrace', - lineno: 18, - colno: 4, - in_app: true, - }, - { - filename: 'http://path/to/file.js', - abs_path: 'http://path/to/file.js', - function: 'run', - lineno: 27, - colno: 8, - in_app: true, - }, - { - filename: 'http://path/to/file.js', - abs_path: 'http://path/to/file.js', - function: 'createException', - lineno: 42, - colno: 12, - in_app: true, - }, + { filename: 'http://path/to/file.js', function: '?', lineno: 15, colno: 3, in_app: true }, + { filename: 'http://path/to/file.js', function: 'foo', lineno: 11, colno: 4, in_app: true }, + { filename: 'http://path/to/file.js', function: 'bar', lineno: 7, colno: 4, in_app: true }, + { filename: 'http://path/to/file.js', function: 'bar', lineno: 4, colno: 5, in_app: true }, + { filename: 'http://path/to/file.js', function: 'printStackTrace', lineno: 18, colno: 4, in_app: true }, + { filename: 'http://path/to/file.js', function: 'run', lineno: 27, colno: 8, in_app: true }, + { filename: 'http://path/to/file.js', function: 'createException', lineno: 42, colno: 12, in_app: true }, ], }, }); @@ -213,7 +122,6 @@ describe('Tracekit - Opera Tests', () => { frames: [ { filename: 'http://localhost:8000/ExceptionLab.html', - abs_path: 'http://localhost:8000/ExceptionLab.html', function: '', lineno: 1, colno: 0, @@ -221,7 +129,6 @@ describe('Tracekit - Opera Tests', () => { }, { filename: 'http://localhost:8000/ExceptionLab.html', - abs_path: 'http://localhost:8000/ExceptionLab.html', function: 'dumpException3', lineno: 46, colno: 8, @@ -229,7 +136,6 @@ describe('Tracekit - Opera Tests', () => { }, { filename: 'http://localhost:8000/ExceptionLab.html', - abs_path: 'http://localhost:8000/ExceptionLab.html', function: '', lineno: 48, colno: 12, @@ -258,30 +164,9 @@ describe('Tracekit - Opera Tests', () => { type: 'TypeError', stacktrace: { frames: [ - { - filename: 'http://path/to/file.js', - abs_path: 'http://path/to/file.js', - function: 'bar', - lineno: 108, - colno: 168, - in_app: true, - }, - { - filename: 'http://path/to/file.js', - abs_path: 'http://path/to/file.js', - function: 'foo', - lineno: 52, - colno: 15, - in_app: true, - }, - { - filename: 'http://path/to/file.js', - abs_path: 'http://path/to/file.js', - function: '?', - lineno: 47, - colno: 22, - in_app: true, - }, + { filename: 'http://path/to/file.js', function: 'bar', lineno: 108, colno: 168, in_app: true }, + { filename: 'http://path/to/file.js', function: 'foo', lineno: 52, colno: 15, in_app: true }, + { filename: 'http://path/to/file.js', function: '?', lineno: 47, colno: 22, in_app: true }, ], }, }); diff --git a/packages/browser/test/unit/tracekit/react-native.test.ts b/packages/browser/test/unit/tracekit/react-native.test.ts index 7615a27c4afe..9a74e46007b1 100644 --- a/packages/browser/test/unit/tracekit/react-native.test.ts +++ b/packages/browser/test/unit/tracekit/react-native.test.ts @@ -22,41 +22,18 @@ describe('Tracekit - React Native Tests', () => { type: 'Error', stacktrace: { frames: [ + { filename: 'index.android.bundle', function: 'P', lineno: 93, colno: 714, in_app: true }, + { filename: 'index.android.bundle', function: 'Object.y', lineno: 93, colno: 571, in_app: true }, { filename: 'index.android.bundle', - abs_path: 'index.android.bundle', - function: 'P', - lineno: 93, - colno: 714, - in_app: true, - }, - { - filename: 'index.android.bundle', - abs_path: 'index.android.bundle', - function: 'Object.y', - lineno: 93, - colno: 571, - in_app: true, - }, - { - filename: 'index.android.bundle', - abs_path: 'index.android.bundle', function: 's.touchableHandleResponderRelease', lineno: 198, colno: 5615, in_app: true, }, + { filename: 'index.android.bundle', function: 's._receiveSignal', lineno: 198, colno: 8309, in_app: true }, { filename: 'index.android.bundle', - abs_path: 'index.android.bundle', - function: 's._receiveSignal', - lineno: 198, - colno: 8309, - in_app: true, - }, - { - filename: 'index.android.bundle', - abs_path: 'index.android.bundle', function: 's._performSideEffectsForTransition', lineno: 198, colno: 9608, @@ -64,20 +41,12 @@ describe('Tracekit - React Native Tests', () => { }, { filename: 'index.android.bundle', - abs_path: 'index.android.bundle', function: 's.touchableHandlePress', lineno: 214, colno: 2048, in_app: true, }, - { - filename: 'index.android.bundle', - abs_path: 'index.android.bundle', - function: 'Object.onPress', - lineno: 2342, - colno: 3773, - in_app: true, - }, + { filename: 'index.android.bundle', function: 'Object.onPress', lineno: 2342, colno: 3773, in_app: true }, ], }, }); @@ -100,12 +69,10 @@ describe('Tracekit - React Native Tests', () => { type: 'Error', stacktrace: { frames: [ - { filename: '[native code]', abs_path: '[native code]', function: 'forEach', in_app: true }, + { filename: '[native code]', function: 'forEach', in_app: true }, { filename: '/data/user/0/com.sentrytest/files/.expo-internal/bundle-613EDD44F3305B9D75D4679663900F2BCDDDC326F247CA3202A3A4219FD412D3', - abs_path: - '/data/user/0/com.sentrytest/files/.expo-internal/bundle-613EDD44F3305B9D75D4679663900F2BCDDDC326F247CA3202A3A4219FD412D3', function: 'p', lineno: 96, colno: 385, @@ -114,8 +81,6 @@ describe('Tracekit - React Native Tests', () => { { filename: '/data/user/0/com.sentrytest/files/.expo-internal/bundle-613EDD44F3305B9D75D4679663900F2BCDDDC326F247CA3202A3A4219FD412D3', - abs_path: - '/data/user/0/com.sentrytest/files/.expo-internal/bundle-613EDD44F3305B9D75D4679663900F2BCDDDC326F247CA3202A3A4219FD412D3', function: 'onResponderRelease', lineno: 221, colno: 5666, @@ -124,8 +89,6 @@ describe('Tracekit - React Native Tests', () => { { filename: '/data/user/0/com.sentrytest/files/.expo-internal/bundle-613EDD44F3305B9D75D4679663900F2BCDDDC326F247CA3202A3A4219FD412D3', - abs_path: - '/data/user/0/com.sentrytest/files/.expo-internal/bundle-613EDD44F3305B9D75D4679663900F2BCDDDC326F247CA3202A3A4219FD412D3', function: 'value', lineno: 221, colno: 7656, @@ -134,8 +97,6 @@ describe('Tracekit - React Native Tests', () => { { filename: '/data/user/0/com.sentrytest/files/.expo-internal/bundle-613EDD44F3305B9D75D4679663900F2BCDDDC326F247CA3202A3A4219FD412D3', - abs_path: - '/data/user/0/com.sentrytest/files/.expo-internal/bundle-613EDD44F3305B9D75D4679663900F2BCDDDC326F247CA3202A3A4219FD412D3', function: 'onPress', lineno: 595, colno: 658, @@ -172,8 +133,6 @@ describe('Tracekit - React Native Tests', () => { { filename: '/home/username/sample-workspace/sampleapp.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/native/ReactNativeBaseComponent.js', - abs_path: - '/home/username/sample-workspace/sampleapp.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/native/ReactNativeBaseComponent.js', function: 'this', lineno: 74, colno: 41, @@ -182,8 +141,6 @@ describe('Tracekit - React Native Tests', () => { { filename: '/home/username/sample-workspace/sampleapp.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactMultiChild.js', - abs_path: - '/home/username/sample-workspace/sampleapp.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactMultiChild.js', function: 'children', lineno: 264, colno: 10, @@ -192,8 +149,6 @@ describe('Tracekit - React Native Tests', () => { { filename: '/home/username/sample-workspace/sampleapp.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactReconciler.js', - abs_path: - '/home/username/sample-workspace/sampleapp.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactReconciler.js', function: 'child', lineno: 68, colno: 25, @@ -202,8 +157,6 @@ describe('Tracekit - React Native Tests', () => { { filename: '/home/username/sample-workspace/sampleapp.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js', - abs_path: - '/home/username/sample-workspace/sampleapp.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js', function: '_currentElement', lineno: 346, colno: 40, @@ -212,8 +165,6 @@ describe('Tracekit - React Native Tests', () => { { filename: '/home/username/sample-workspace/sampleapp.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js', - abs_path: - '/home/username/sample-workspace/sampleapp.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js', function: 'renderedElement', lineno: 484, colno: 29, @@ -222,8 +173,6 @@ describe('Tracekit - React Native Tests', () => { { filename: '/home/username/sample-workspace/sampleapp.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js', - abs_path: - '/home/username/sample-workspace/sampleapp.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js', function: '_renderValidatedComponent', lineno: 1075, colno: 15, @@ -232,8 +181,6 @@ describe('Tracekit - React Native Tests', () => { { filename: '/home/username/sample-workspace/sampleapp.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js', - abs_path: - '/home/username/sample-workspace/sampleapp.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js', function: '_renderValidatedComponentWithoutOwnerOrContext', lineno: 1050, colno: 29, @@ -241,7 +188,6 @@ describe('Tracekit - React Native Tests', () => { }, { filename: '/home/username/sample-workspace/sampleapp.collect.react/src/components/GpsMonitorScene.js', - abs_path: '/home/username/sample-workspace/sampleapp.collect.react/src/components/GpsMonitorScene.js', function: 'render', lineno: 78, colno: 24, @@ -303,260 +249,73 @@ describe('Tracekit - React Native Tests', () => { type: 'Error', stacktrace: { frames: [ - { filename: '[native code]', abs_path: '[native code]', function: '?', in_app: true }, - { - filename: 'index.android.bundle', - abs_path: 'index.android.bundle', - function: 'value', - lineno: 29, - colno: 927, - in_app: true, - }, - { - filename: 'index.android.bundle', - abs_path: 'index.android.bundle', - function: 'value', - lineno: 29, - colno: 2417, - in_app: true, - }, - { - filename: 'index.android.bundle', - abs_path: 'index.android.bundle', - function: '?', - lineno: 29, - colno: 955, - in_app: true, - }, - { - filename: 'index.android.bundle', - abs_path: 'index.android.bundle', - function: 'value', - lineno: 29, - colno: 3016, - in_app: true, - }, - { - filename: 'index.android.bundle', - abs_path: 'index.android.bundle', - function: 'receiveTouches', - lineno: 156, - colno: 918, - in_app: true, - }, + { filename: '[native code]', function: '?', in_app: true }, + { filename: 'index.android.bundle', function: 'value', lineno: 29, colno: 927, in_app: true }, + { filename: 'index.android.bundle', function: 'value', lineno: 29, colno: 2417, in_app: true }, + { filename: 'index.android.bundle', function: '?', lineno: 29, colno: 955, in_app: true }, + { filename: 'index.android.bundle', function: 'value', lineno: 29, colno: 3016, in_app: true }, + { filename: 'index.android.bundle', function: 'receiveTouches', lineno: 156, colno: 918, in_app: true }, { filename: 'index.android.bundle', - abs_path: 'index.android.bundle', function: '_receiveRootNodeIDEvent', lineno: 156, colno: 544, in_app: true, }, + { filename: 'index.android.bundle', function: 'u', lineno: 93, colno: 150, in_app: true }, + { filename: 'index.android.bundle', function: 'i', lineno: 93, colno: 90, in_app: true }, + { filename: 'index.android.bundle', function: 'i', lineno: 176, colno: 358, in_app: true }, + { filename: 'index.android.bundle', function: 'batchedUpdates', lineno: 188, colno: 464, in_app: true }, + { filename: 'index.android.bundle', function: 'perform', lineno: 177, colno: 596, in_app: true }, + { filename: 'index.android.bundle', function: 'c', lineno: 93, colno: 60, in_app: true }, + { filename: 'index.android.bundle', function: 'a', lineno: 93, colno: 276, in_app: true }, + { filename: 'index.android.bundle', function: '?', lineno: 156, colno: 572, in_app: true }, + { filename: 'index.android.bundle', function: 'handleTopLevel', lineno: 157, colno: 174, in_app: true }, + { filename: 'index.android.bundle', function: 's', lineno: 157, colno: 88, in_app: true }, + { filename: 'index.android.bundle', function: 'processEventQueue', lineno: 146, colno: 1432, in_app: true }, + { filename: 'index.android.bundle', function: 'i', lineno: 149, colno: 80, in_app: true }, + { filename: '[native code]', function: 'forEach', in_app: true }, + { filename: 'index.android.bundle', function: 'g', lineno: 146, colno: 604, in_app: true }, + { filename: 'index.android.bundle', function: 'v', lineno: 146, colno: 501, in_app: true }, + { filename: 'index.android.bundle', function: 'a', lineno: 95, colno: 567, in_app: true }, + { filename: 'index.android.bundle', function: 'c', lineno: 95, colno: 365, in_app: true }, { filename: 'index.android.bundle', - abs_path: 'index.android.bundle', - function: 'u', - lineno: 93, - colno: 150, - in_app: true, - }, - { - filename: 'index.android.bundle', - abs_path: 'index.android.bundle', - function: 'i', - lineno: 93, - colno: 90, - in_app: true, - }, - { - filename: 'index.android.bundle', - abs_path: 'index.android.bundle', - function: 'i', - lineno: 176, - colno: 358, - in_app: true, - }, - { - filename: 'index.android.bundle', - abs_path: 'index.android.bundle', - function: 'batchedUpdates', - lineno: 188, - colno: 464, - in_app: true, - }, - { - filename: 'index.android.bundle', - abs_path: 'index.android.bundle', - function: 'perform', - lineno: 177, - colno: 596, - in_app: true, - }, - { - filename: 'index.android.bundle', - abs_path: 'index.android.bundle', - function: 'c', - lineno: 93, - colno: 60, - in_app: true, - }, - { - filename: 'index.android.bundle', - abs_path: 'index.android.bundle', - function: 'a', - lineno: 93, - colno: 276, - in_app: true, - }, - { - filename: 'index.android.bundle', - abs_path: 'index.android.bundle', - function: '?', - lineno: 156, - colno: 572, - in_app: true, - }, - { - filename: 'index.android.bundle', - abs_path: 'index.android.bundle', - function: 'handleTopLevel', - lineno: 157, - colno: 174, - in_app: true, - }, - { - filename: 'index.android.bundle', - abs_path: 'index.android.bundle', - function: 's', - lineno: 157, - colno: 88, - in_app: true, - }, - { - filename: 'index.android.bundle', - abs_path: 'index.android.bundle', - function: 'processEventQueue', - lineno: 146, - colno: 1432, - in_app: true, - }, - { - filename: 'index.android.bundle', - abs_path: 'index.android.bundle', - function: 'i', - lineno: 149, - colno: 80, - in_app: true, - }, - { filename: '[native code]', abs_path: '[native code]', function: 'forEach', in_app: true }, - { - filename: 'index.android.bundle', - abs_path: 'index.android.bundle', - function: 'g', - lineno: 146, - colno: 604, - in_app: true, - }, - { - filename: 'index.android.bundle', - abs_path: 'index.android.bundle', - function: 'v', - lineno: 146, - colno: 501, - in_app: true, - }, - { - filename: 'index.android.bundle', - abs_path: 'index.android.bundle', - function: 'a', - lineno: 95, - colno: 567, - in_app: true, - }, - { - filename: 'index.android.bundle', - abs_path: 'index.android.bundle', - function: 'c', - lineno: 95, - colno: 365, - in_app: true, - }, - { - filename: 'index.android.bundle', - abs_path: 'index.android.bundle', function: 'invokeGuardedCallbackAndCatchFirstError', lineno: 79, colno: 580, in_app: true, }, + { filename: 'index.android.bundle', function: 'invokeGuardedCallback', lineno: 79, colno: 459, in_app: true }, + { filename: 'index.android.bundle', function: 'u', lineno: 79, colno: 142, in_app: true }, + { filename: '[native code]', function: '?', in_app: true }, { filename: 'index.android.bundle', - abs_path: 'index.android.bundle', - function: 'invokeGuardedCallback', - lineno: 79, - colno: 459, - in_app: true, - }, - { - filename: 'index.android.bundle', - abs_path: 'index.android.bundle', - function: 'u', - lineno: 79, - colno: 142, - in_app: true, - }, - { filename: '[native code]', abs_path: '[native code]', function: '?', in_app: true }, - { - filename: 'index.android.bundle', - abs_path: 'index.android.bundle', function: 'touchableHandleResponderRelease', lineno: 252, colno: 4735, in_app: true, }, - { filename: '[native code]', abs_path: '[native code]', function: '?', in_app: true }, + { filename: '[native code]', function: '?', in_app: true }, + { filename: 'index.android.bundle', function: '_receiveSignal', lineno: 252, colno: 7291, in_app: true }, + { filename: '[native code]', function: '?', in_app: true }, { filename: 'index.android.bundle', - abs_path: 'index.android.bundle', - function: '_receiveSignal', - lineno: 252, - colno: 7291, - in_app: true, - }, - { filename: '[native code]', abs_path: '[native code]', function: '?', in_app: true }, - { - filename: 'index.android.bundle', - abs_path: 'index.android.bundle', function: '_performSideEffectsForTransition', lineno: 252, colno: 8508, in_app: true, }, - { filename: '[native code]', abs_path: '[native code]', function: '?', in_app: true }, + { filename: '[native code]', function: '?', in_app: true }, { filename: 'index.android.bundle', - abs_path: 'index.android.bundle', function: 'touchableHandlePress', lineno: 258, colno: 1497, in_app: true, }, - { - filename: 'index.android.bundle', - abs_path: 'index.android.bundle', - function: 'onPress', - lineno: 12, - colno: 2336, - in_app: true, - }, - { - filename: 'index.android.bundle', - abs_path: 'index.android.bundle', - function: 'value', - lineno: 12, - colno: 1917, - in_app: true, - }, + { filename: 'index.android.bundle', function: 'onPress', lineno: 12, colno: 2336, in_app: true }, + { filename: 'index.android.bundle', function: 'value', lineno: 12, colno: 1917, in_app: true }, ], }, }); @@ -601,168 +360,38 @@ describe('Tracekit - React Native Tests', () => { type: 'Error', stacktrace: { frames: [ + { filename: 'index.android.bundle', function: 'value', lineno: 1, colno: 31561, in_app: true }, + { filename: 'index.android.bundle', function: 'value', lineno: 1, colno: 32776, in_app: true }, + { filename: 'index.android.bundle', function: 'anonymous', lineno: 1, colno: 31603, in_app: true }, + { filename: 'index.android.bundle', function: 'value', lineno: 1, colno: 33176, in_app: true }, + { filename: 'native', function: 'apply', in_app: true }, + { filename: 'index.android.bundle', function: 'receiveTouches', lineno: 1, colno: 122512, in_app: true }, + { filename: 'index.android.bundle', function: 'Ue', lineno: 1, colno: 77571, in_app: true }, + { filename: 'index.android.bundle', function: 'Ne', lineno: 1, colno: 77238, in_app: true }, + { filename: 'index.android.bundle', function: '_e', lineno: 1, colno: 127755, in_app: true }, + { filename: 'index.android.bundle', function: 'anonymous', lineno: 1, colno: 77747, in_app: true }, + { filename: 'index.android.bundle', function: 'z', lineno: 1, colno: 74642, in_app: true }, + { filename: 'native', function: 'forEach', in_app: true }, + { filename: 'index.android.bundle', function: 'A', lineno: 1, colno: 74709, in_app: true }, + { filename: 'index.android.bundle', function: 'N', lineno: 1, colno: 74267, in_app: true }, + { filename: 'index.android.bundle', function: 'C', lineno: 1, colno: 74126, in_app: true }, + { filename: 'native', function: 'apply', in_app: true }, + { filename: 'index.android.bundle', function: 'k', lineno: 1, colno: 74094, in_app: true }, + { filename: 'native', function: 'apply', in_app: true }, + { filename: 'index.android.bundle', function: 'b', lineno: 1, colno: 74037, in_app: true }, + { filename: 'native', function: 'apply', in_app: true }, + { filename: 'native', function: 'onResponderRelease', in_app: true }, + { filename: 'native', function: 'touchableHandleResponderRelease', in_app: true }, + { filename: 'native', function: '_receiveSignal', in_app: true }, { filename: 'index.android.bundle', - abs_path: 'index.android.bundle', - function: 'value', - lineno: 1, - colno: 31561, - in_app: true, - }, - { - filename: 'index.android.bundle', - abs_path: 'index.android.bundle', - function: 'value', - lineno: 1, - colno: 32776, - in_app: true, - }, - { - filename: 'index.android.bundle', - abs_path: 'index.android.bundle', - function: 'anonymous', - lineno: 1, - colno: 31603, - in_app: true, - }, - { - filename: 'index.android.bundle', - abs_path: 'index.android.bundle', - function: 'value', - lineno: 1, - colno: 33176, - in_app: true, - }, - { - filename: 'native', - abs_path: 'native', - function: 'apply', - in_app: true, - }, - { - filename: 'index.android.bundle', - abs_path: 'index.android.bundle', - function: 'receiveTouches', - lineno: 1, - colno: 122512, - in_app: true, - }, - { - filename: 'index.android.bundle', - abs_path: 'index.android.bundle', - function: 'Ue', - lineno: 1, - colno: 77571, - in_app: true, - }, - { - filename: 'index.android.bundle', - abs_path: 'index.android.bundle', - function: 'Ne', - lineno: 1, - colno: 77238, - in_app: true, - }, - { - filename: 'index.android.bundle', - abs_path: 'index.android.bundle', - function: '_e', - lineno: 1, - colno: 127755, - in_app: true, - }, - { - filename: 'index.android.bundle', - abs_path: 'index.android.bundle', - function: 'anonymous', - lineno: 1, - colno: 77747, - in_app: true, - }, - { - filename: 'index.android.bundle', - abs_path: 'index.android.bundle', - function: 'z', - lineno: 1, - colno: 74642, - in_app: true, - }, - { - filename: 'native', - abs_path: 'native', - function: 'forEach', - in_app: true, - }, - { - filename: 'index.android.bundle', - abs_path: 'index.android.bundle', - function: 'A', - lineno: 1, - colno: 74709, - in_app: true, - }, - { - filename: 'index.android.bundle', - abs_path: 'index.android.bundle', - function: 'N', - lineno: 1, - colno: 74267, - in_app: true, - }, - { - filename: 'index.android.bundle', - abs_path: 'index.android.bundle', - function: 'C', - lineno: 1, - colno: 74126, - in_app: true, - }, - { filename: 'native', abs_path: 'native', function: 'apply', in_app: true }, - { - filename: 'index.android.bundle', - abs_path: 'index.android.bundle', - function: 'k', - lineno: 1, - colno: 74094, - in_app: true, - }, - { filename: 'native', abs_path: 'native', function: 'apply', in_app: true }, - { - filename: 'index.android.bundle', - abs_path: 'index.android.bundle', - function: 'b', - lineno: 1, - colno: 74037, - in_app: true, - }, - { filename: 'native', abs_path: 'native', function: 'apply', in_app: true }, - { filename: 'native', abs_path: 'native', function: 'onResponderRelease', in_app: true }, - { filename: 'native', abs_path: 'native', function: 'touchableHandleResponderRelease', in_app: true }, - { filename: 'native', abs_path: 'native', function: '_receiveSignal', in_app: true }, - { - filename: 'index.android.bundle', - abs_path: 'index.android.bundle', function: '_performSideEffectsForTransition', lineno: 1, colno: 230843, in_app: true, }, - { - filename: 'index.android.bundle', - abs_path: 'index.android.bundle', - function: 'anonymous', - lineno: 1, - colno: 224280, - in_app: true, - }, - { - filename: 'index.android.bundle', - abs_path: 'index.android.bundle', - function: 'onPress', - lineno: 1, - colno: 452701, - in_app: true, - }, + { filename: 'index.android.bundle', function: 'anonymous', lineno: 1, colno: 224280, in_app: true }, + { filename: 'index.android.bundle', function: 'onPress', lineno: 1, colno: 452701, in_app: true }, ], }, }); diff --git a/packages/browser/test/unit/tracekit/react.test.ts b/packages/browser/test/unit/tracekit/react.test.ts index 5ebaa602ed06..d949a4dee0eb 100644 --- a/packages/browser/test/unit/tracekit/react.test.ts +++ b/packages/browser/test/unit/tracekit/react.test.ts @@ -23,17 +23,9 @@ describe('Tracekit - React Tests', () => { type: 'Invariant Violation', stacktrace: { frames: [ - { - filename: 'http://localhost:5000/', - abs_path: 'http://localhost:5000/', - function: 'f', - lineno: 1, - colno: 980, - in_app: true, - }, + { filename: 'http://localhost:5000/', function: 'f', lineno: 1, colno: 980, in_app: true }, { filename: 'http://localhost:5000/static/js/foo.chunk.js', - abs_path: 'http://localhost:5000/static/js/foo.chunk.js', function: 'ho', lineno: 1, colno: 68735, @@ -41,7 +33,6 @@ describe('Tracekit - React Tests', () => { }, { filename: 'http://localhost:5000/static/js/foo.chunk.js', - abs_path: 'http://localhost:5000/static/js/foo.chunk.js', function: 'a', lineno: 1, colno: 21841, @@ -49,7 +40,6 @@ describe('Tracekit - React Tests', () => { }, { filename: 'http://localhost:5000/static/js/foo.chunk.js', - abs_path: 'http://localhost:5000/static/js/foo.chunk.js', function: '?', lineno: 1, colno: 21738, @@ -80,17 +70,9 @@ describe('Tracekit - React Tests', () => { type: 'Error', stacktrace: { frames: [ - { - filename: 'http://localhost:5000/', - abs_path: 'http://localhost:5000/', - function: 'f', - lineno: 1, - colno: 980, - in_app: true, - }, + { filename: 'http://localhost:5000/', function: 'f', lineno: 1, colno: 980, in_app: true }, { filename: 'http://localhost:5000/static/js/foo.chunk.js', - abs_path: 'http://localhost:5000/static/js/foo.chunk.js', function: 'ho', lineno: 1, colno: 68735, @@ -98,7 +80,6 @@ describe('Tracekit - React Tests', () => { }, { filename: 'http://localhost:5000/static/js/foo.chunk.js', - abs_path: 'http://localhost:5000/static/js/foo.chunk.js', function: 'a', lineno: 1, colno: 21841, @@ -106,7 +87,6 @@ describe('Tracekit - React Tests', () => { }, { filename: 'http://localhost:5000/static/js/foo.chunk.js', - abs_path: 'http://localhost:5000/static/js/foo.chunk.js', function: '?', lineno: 1, colno: 21738, @@ -138,17 +118,9 @@ describe('Tracekit - React Tests', () => { type: 'Error', stacktrace: { frames: [ - { - filename: 'http://localhost:5000/', - abs_path: 'http://localhost:5000/', - function: 'f', - lineno: 1, - colno: 980, - in_app: true, - }, + { filename: 'http://localhost:5000/', function: 'f', lineno: 1, colno: 980, in_app: true }, { filename: 'http://localhost:5000/static/js/foo.chunk.js', - abs_path: 'http://localhost:5000/static/js/foo.chunk.js', function: 'ho', lineno: 1, colno: 68735, @@ -156,7 +128,6 @@ describe('Tracekit - React Tests', () => { }, { filename: 'http://localhost:5000/static/js/foo.chunk.js', - abs_path: 'http://localhost:5000/static/js/foo.chunk.js', function: 'a', lineno: 1, colno: 21841, @@ -164,7 +135,6 @@ describe('Tracekit - React Tests', () => { }, { filename: 'http://localhost:5000/static/js/foo.chunk.js', - abs_path: 'http://localhost:5000/static/js/foo.chunk.js', function: '?', lineno: 1, colno: 21738, diff --git a/packages/browser/test/unit/tracekit/safari.test.ts b/packages/browser/test/unit/tracekit/safari.test.ts index c2ff37cdfe4c..657ffc7daecc 100644 --- a/packages/browser/test/unit/tracekit/safari.test.ts +++ b/packages/browser/test/unit/tracekit/safari.test.ts @@ -22,28 +22,10 @@ describe('Tracekit - Safari Tests', () => { type: 'foo', stacktrace: { frames: [ - { filename: '[native code]', abs_path: '[native code]', function: '?', in_app: true }, - { - filename: 'http://path/to/file.js', - abs_path: 'http://path/to/file.js', - function: 'onclick', - lineno: 82, - in_app: true, - }, - { - filename: 'http://path/to/file.js', - abs_path: 'http://path/to/file.js', - function: 'dumpException3', - lineno: 52, - in_app: true, - }, - { - filename: 'http://path/to/file.js', - abs_path: 'http://path/to/file.js', - function: '?', - lineno: 48, - in_app: true, - }, + { filename: '[native code]', function: '?', in_app: true }, + { filename: 'http://path/to/file.js', function: 'onclick', lineno: 82, in_app: true }, + { filename: 'http://path/to/file.js', function: 'dumpException3', lineno: 52, in_app: true }, + { filename: 'http://path/to/file.js', function: '?', lineno: 48, in_app: true }, ], }, }); @@ -66,30 +48,9 @@ describe('Tracekit - Safari Tests', () => { type: 'TypeError', stacktrace: { frames: [ - { - filename: 'http://path/to/file.js', - abs_path: 'http://path/to/file.js', - function: 'bar', - lineno: 108, - colno: 107, - in_app: true, - }, - { - filename: 'http://path/to/file.js', - abs_path: 'http://path/to/file.js', - function: 'foo', - lineno: 52, - colno: 15, - in_app: true, - }, - { - filename: 'http://path/to/file.js', - abs_path: 'http://path/to/file.js', - function: '?', - lineno: 48, - colno: 22, - in_app: true, - }, + { filename: 'http://path/to/file.js', function: 'bar', lineno: 108, colno: 107, in_app: true }, + { filename: 'http://path/to/file.js', function: 'foo', lineno: 52, colno: 15, in_app: true }, + { filename: 'http://path/to/file.js', function: '?', lineno: 48, colno: 22, in_app: true }, ], }, }); @@ -113,30 +74,9 @@ describe('Tracekit - Safari Tests', () => { type: 'TypeError', stacktrace: { frames: [ - { - filename: 'http://path/to/file.js', - abs_path: 'http://path/to/file.js', - function: 'bar', - lineno: 108, - colno: 23, - in_app: true, - }, - { - filename: 'http://path/to/file.js', - abs_path: 'http://path/to/file.js', - function: 'foo', - lineno: 52, - colno: 15, - in_app: true, - }, - { - filename: 'http://path/to/file.js', - abs_path: 'http://path/to/file.js', - function: '?', - lineno: 47, - colno: 22, - in_app: true, - }, + { filename: 'http://path/to/file.js', function: 'bar', lineno: 108, colno: 23, in_app: true }, + { filename: 'http://path/to/file.js', function: 'foo', lineno: 52, colno: 15, in_app: true }, + { filename: 'http://path/to/file.js', function: '?', lineno: 47, colno: 22, in_app: true }, ], }, }); @@ -164,23 +104,9 @@ describe('Tracekit - Safari Tests', () => { type: 'ReferenceError', stacktrace: { frames: [ - { - filename: 'http://path/to/file.js', - abs_path: 'http://path/to/file.js', - function: 'bar', - lineno: 109, - colno: 91, - in_app: true, - }, - { - filename: 'http://path/to/file.js', - abs_path: 'http://path/to/file.js', - function: 'foo', - lineno: 58, - colno: 21, - in_app: true, - }, - { filename: '[native code]', abs_path: '[native code]', function: 'eval', in_app: true }, + { filename: 'http://path/to/file.js', function: 'bar', lineno: 109, colno: 91, in_app: true }, + { filename: 'http://path/to/file.js', function: 'foo', lineno: 58, colno: 21, in_app: true }, + { filename: '[native code]', function: 'eval', in_app: true }, ], }, }); @@ -205,7 +131,6 @@ describe('Tracekit - Safari Tests', () => { frames: [ { filename: 'safari-extension://3284871F-A480-4FFC-8BC4-3F362C752446/2665fee0/topee-content.js', - abs_path: 'safari-extension://3284871F-A480-4FFC-8BC4-3F362C752446/2665fee0/topee-content.js', function: '?', lineno: 3313, colno: 26, @@ -213,7 +138,6 @@ describe('Tracekit - Safari Tests', () => { }, { filename: 'safari-extension://3284871F-A480-4FFC-8BC4-3F362C752446/2665fee0/commons.js', - abs_path: 'safari-extension://3284871F-A480-4FFC-8BC4-3F362C752446/2665fee0/commons.js', function: 'ClipperError', lineno: 223036, colno: 10, @@ -239,10 +163,9 @@ describe('Tracekit - Safari Tests', () => { type: 'TypeError', stacktrace: { frames: [ - { filename: '[native code]', abs_path: '[native code]', function: 'promiseReactionJob', in_app: true }, + { filename: '[native code]', function: 'promiseReactionJob', in_app: true }, { filename: 'safari-extension://com.grammarly.safari.extension.ext2-W8F64X92K3/ee7759dd/Grammarly.js', - abs_path: 'safari-extension://com.grammarly.safari.extension.ext2-W8F64X92K3/ee7759dd/Grammarly.js', function: '?', lineno: 2, colno: 1588410, @@ -250,7 +173,6 @@ describe('Tracekit - Safari Tests', () => { }, { filename: 'safari-extension://com.grammarly.safari.extension.ext2-W8F64X92K3/ee7759dd/Grammarly.js', - abs_path: 'safari-extension://com.grammarly.safari.extension.ext2-W8F64X92K3/ee7759dd/Grammarly.js', function: 'isClaimed', lineno: 2, colno: 929865, @@ -279,7 +201,6 @@ describe('Tracekit - Safari Tests', () => { frames: [ { filename: 'safari-web-extension://3284871F-A480-4FFC-8BC4-3F362C752446/2665fee0/topee-content.js', - abs_path: 'safari-web-extension://3284871F-A480-4FFC-8BC4-3F362C752446/2665fee0/topee-content.js', function: '?', lineno: 3313, colno: 26, @@ -287,7 +208,6 @@ describe('Tracekit - Safari Tests', () => { }, { filename: 'safari-web-extension://3284871F-A480-4FFC-8BC4-3F362C752446/2665fee0/commons.js', - abs_path: 'safari-web-extension://3284871F-A480-4FFC-8BC4-3F362C752446/2665fee0/commons.js', function: 'ClipperError', lineno: 223036, colno: 10, @@ -313,10 +233,9 @@ describe('Tracekit - Safari Tests', () => { type: 'TypeError', stacktrace: { frames: [ - { filename: '[native code]', abs_path: '[native code]', function: 'promiseReactionJob', in_app: true }, + { filename: '[native code]', function: 'promiseReactionJob', in_app: true }, { filename: 'safari-web-extension://46434E60-F5BD-48A4-80C8-A422C5D16897/scripts/content-script.js', - abs_path: 'safari-web-extension://46434E60-F5BD-48A4-80C8-A422C5D16897/scripts/content-script.js', function: '?', lineno: 29, colno: 56027, @@ -324,7 +243,6 @@ describe('Tracekit - Safari Tests', () => { }, { filename: 'safari-web-extension://46434E60-F5BD-48A4-80C8-A422C5D16897/scripts/content-script.js', - abs_path: 'safari-web-extension://46434E60-F5BD-48A4-80C8-A422C5D16897/scripts/content-script.js', function: 'p_', lineno: 29, colno: 33314, @@ -353,31 +271,10 @@ describe('Tracekit - Safari Tests', () => { type: 'Error', stacktrace: { frames: [ - { - filename: 'http://localhost:5000/test', - abs_path: 'http://localhost:5000/test', - function: 'global code', - lineno: 24, - colno: 10, - in_app: true, - }, - { - filename: 'http://localhost:5000/test', - abs_path: 'http://localhost:5000/test', - function: 'foo', - lineno: 19, - colno: 22, - in_app: true, - }, - { filename: '[native code]', abs_path: '[native code]', function: 'map', in_app: true }, - { - filename: 'http://localhost:5000/test', - abs_path: 'http://localhost:5000/test', - function: 'fooIterator', - lineno: 20, - colno: 26, - in_app: true, - }, + { filename: 'http://localhost:5000/test', function: 'global code', lineno: 24, colno: 10, in_app: true }, + { filename: 'http://localhost:5000/test', function: 'foo', lineno: 19, colno: 22, in_app: true }, + { filename: '[native code]', function: 'map', in_app: true }, + { filename: 'http://localhost:5000/test', function: 'fooIterator', lineno: 20, colno: 26, in_app: true }, ], }, }); @@ -408,73 +305,17 @@ describe('Tracekit - Safari Tests', () => { type: 'Error', stacktrace: { frames: [ - { - filename: 'http://localhost:5000/', - abs_path: 'http://localhost:5000/', - function: '?', - lineno: 50, - colno: 29, - in_app: true, - }, - { - filename: 'http://localhost:5000/', - abs_path: 'http://localhost:5000/', - function: 'testMethod', - lineno: 44, - colno: 10, - in_app: true, - }, - { - filename: 'http://localhost:5000/', - abs_path: 'http://localhost:5000/', - function: 'aha', - lineno: 39, - colno: 9, - in_app: true, - }, - { filename: '[native code]', abs_path: '[native code]', function: 'eval', in_app: true }, - { - filename: 'http://localhost:5000/', - abs_path: 'http://localhost:5000/', - function: 'test', - lineno: 33, - colno: 26, - in_app: true, - }, - { filename: '[native code]', abs_path: '[native code]', function: 'map', in_app: true }, - { - filename: 'http://localhost:5000/', - abs_path: 'http://localhost:5000/', - function: '?', - lineno: 34, - colno: 25, - in_app: true, - }, - { - filename: 'http://localhost:5000/', - abs_path: 'http://localhost:5000/', - function: 'callback', - lineno: 25, - colno: 23, - in_app: true, - }, - { - filename: 'http://localhost:5000/', - abs_path: 'http://localhost:5000/', - function: 'callAnotherThing', - lineno: 20, - colno: 16, - in_app: true, - }, - { filename: '[native code]', abs_path: '[native code]', function: 'aha', in_app: true }, - { - filename: 'http://localhost:5000/', - abs_path: 'http://localhost:5000/', - function: 'aha', - lineno: 19, - colno: 22, - in_app: true, - }, + { filename: 'http://localhost:5000/', function: '?', lineno: 50, colno: 29, in_app: true }, + { filename: 'http://localhost:5000/', function: 'testMethod', lineno: 44, colno: 10, in_app: true }, + { filename: 'http://localhost:5000/', function: 'aha', lineno: 39, colno: 9, in_app: true }, + { filename: '[native code]', function: 'eval', in_app: true }, + { filename: 'http://localhost:5000/', function: 'test', lineno: 33, colno: 26, in_app: true }, + { filename: '[native code]', function: 'map', in_app: true }, + { filename: 'http://localhost:5000/', function: '?', lineno: 34, colno: 25, in_app: true }, + { filename: 'http://localhost:5000/', function: 'callback', lineno: 25, colno: 23, in_app: true }, + { filename: 'http://localhost:5000/', function: 'callAnotherThing', lineno: 20, colno: 16, in_app: true }, + { filename: '[native code]', function: 'aha', in_app: true }, + { filename: 'http://localhost:5000/', function: 'aha', lineno: 19, colno: 22, in_app: true }, ], }, }); diff --git a/packages/core/src/utils/prepareEvent.ts b/packages/core/src/utils/prepareEvent.ts index 043dc208bf49..09c6f87dfa8e 100644 --- a/packages/core/src/utils/prepareEvent.ts +++ b/packages/core/src/utils/prepareEvent.ts @@ -124,27 +124,27 @@ export function applyDebugMetadata(event: Event, stackParser: StackParser): void return; } - // Build a map of abs_path -> debug_id - const absPathDebugIdMap = Object.keys(debugIdMap).reduce>((acc, debugIdStackTrace) => { + // Build a map of filename -> debug_id + const filenameDebugIdMap = Object.keys(debugIdMap).reduce>((acc, debugIdStackTrace) => { const parsedStack = stackParser(debugIdStackTrace); for (const stackFrame of parsedStack) { - if (stackFrame.abs_path) { - acc[stackFrame.abs_path] = debugIdMap[debugIdStackTrace]; + if (stackFrame.filename) { + acc[stackFrame.filename] = debugIdMap[debugIdStackTrace]; break; } } return acc; }, {}); - // Get a Set of abs_paths in the stack trace - const errorAbsPaths = new Set(); + // Get a Set of filenames in the stack trace + const errorFileNames = new Set(); try { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion event!.exception!.values!.forEach(exception => { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion exception.stacktrace!.frames!.forEach(frame => { - if (frame.abs_path) { - errorAbsPaths.add(frame.abs_path); + if (frame.filename) { + errorFileNames.add(frame.filename); } }); }); @@ -156,12 +156,12 @@ export function applyDebugMetadata(event: Event, stackParser: StackParser): void event.debug_meta = event.debug_meta || {}; event.debug_meta.images = event.debug_meta.images || []; const images = event.debug_meta.images; - errorAbsPaths.forEach(absPath => { - if (absPathDebugIdMap[absPath]) { + errorFileNames.forEach(filename => { + if (filenameDebugIdMap[filename]) { images.push({ type: 'sourcemap', - code_file: absPath, - debug_id: absPathDebugIdMap[absPath], + code_file: filename, + debug_id: filenameDebugIdMap[filename], }); } }); diff --git a/packages/core/test/lib/prepareEvent.test.ts b/packages/core/test/lib/prepareEvent.test.ts index b4cac98355e0..d08b4ace221d 100644 --- a/packages/core/test/lib/prepareEvent.test.ts +++ b/packages/core/test/lib/prepareEvent.test.ts @@ -15,7 +15,7 @@ describe('applyDebugMetadata', () => { 'filename4.js\nfilename4.js': 'cccccccc-cccc-4ccc-cccc-cccccccccc', }; - const stackParser = createStackParser([0, line => ({ filename: line, abs_path: line })]); + const stackParser = createStackParser([0, line => ({ filename: line })]); const event: Event = { exception: { @@ -23,10 +23,10 @@ describe('applyDebugMetadata', () => { { stacktrace: { frames: [ - { abs_path: 'filename1.js', filename: 'filename1.js' }, - { abs_path: 'filename2.js', filename: 'filename2.js' }, - { abs_path: 'filename1.js', filename: 'filename1.js' }, - { abs_path: 'filename3.js', filename: 'filename3.js' }, + { filename: 'filename1.js' }, + { filename: 'filename2.js' }, + { filename: 'filename1.js' }, + { filename: 'filename3.js' }, ], }, }, diff --git a/packages/e2e-tests/test-applications/nextjs-app-dir/tests/devErrorSymbolification.test.ts b/packages/e2e-tests/test-applications/nextjs-app-dir/tests/devErrorSymbolification.test.ts index 2f7173cee315..f4841c2a6b16 100644 --- a/packages/e2e-tests/test-applications/nextjs-app-dir/tests/devErrorSymbolification.test.ts +++ b/packages/e2e-tests/test-applications/nextjs-app-dir/tests/devErrorSymbolification.test.ts @@ -23,7 +23,6 @@ test.describe('dev mode error symbolification', () => { expect.objectContaining({ function: 'onClick', filename: 'components/client-error-debug-tools.tsx', - abs_path: 'webpack-internal:///(app-client)/./components/client-error-debug-tools.tsx', lineno: 54, colno: 16, in_app: true, diff --git a/packages/nextjs/src/client/index.ts b/packages/nextjs/src/client/index.ts index 650f0607a2a2..d0be07a3c8d0 100644 --- a/packages/nextjs/src/client/index.ts +++ b/packages/nextjs/src/client/index.ts @@ -77,10 +77,8 @@ function addClientIntegrations(options: BrowserOptions): void { // Turn `//_next/static/...` into `app:///_next/static/...` iteratee: frame => { try { - const { origin: absPathOrigin } = new URL(frame.abs_path as string); - const { origin: filenameOrigin } = new URL(frame.filename as string); - frame.abs_path = frame.abs_path?.replace(absPathOrigin, 'app://').replace(assetPrefixPath, ''); - frame.filename = frame.filename?.replace(filenameOrigin, 'app://').replace(assetPrefixPath, ''); + const { origin } = new URL(frame.filename as string); + frame.filename = frame.filename?.replace(origin, 'app://').replace(assetPrefixPath, ''); } catch (err) { // Filename wasn't a properly formed URL, so there's nothing we can do } @@ -90,13 +88,10 @@ function addClientIntegrations(options: BrowserOptions): void { if (frame.filename && frame.filename.startsWith('app:///_next')) { frame.filename = decodeURI(frame.filename); } - if (frame.abs_path && frame.abs_path.startsWith('app:///_next')) { - frame.abs_path = decodeURI(frame.abs_path); - } if ( - frame.abs_path && - frame.abs_path.match( + frame.filename && + frame.filename.match( /^app:\/\/\/_next\/static\/chunks\/(main-|main-app-|polyfills-|webpack-|framework-|framework\.)[0-9a-f]+\.js$/, ) ) { diff --git a/packages/nextjs/src/common/devErrorSymbolicationEventProcessor.ts b/packages/nextjs/src/common/devErrorSymbolicationEventProcessor.ts index 2315f246cc91..7e3fd8baae24 100644 --- a/packages/nextjs/src/common/devErrorSymbolicationEventProcessor.ts +++ b/packages/nextjs/src/common/devErrorSymbolicationEventProcessor.ts @@ -126,7 +126,7 @@ export async function devErrorSymbolicationEventProcessor(event: Event, hint: Ev if (!resolvedFrame || !resolvedFrame.originalStackFrame || !resolvedFrame.originalCodeFrame) { return { ...frame, - platform: frame.abs_path?.startsWith('node:internal') ? 'nodejs' : undefined, // simple hack that will prevent a source mapping error from showing up + platform: frame.filename?.startsWith('node:internal') ? 'nodejs' : undefined, // simple hack that will prevent a source mapping error from showing up in_app: false, }; } diff --git a/packages/types/src/debugMeta.ts b/packages/types/src/debugMeta.ts index 2a6f201874da..da3cf958857b 100644 --- a/packages/types/src/debugMeta.ts +++ b/packages/types/src/debugMeta.ts @@ -17,6 +17,6 @@ interface WasmDebugImage { interface SourceMapDebugImage { type: 'sourcemap'; - code_file: string; // abs_path + code_file: string; // filename debug_id: string; // uuid }