From a189b19b1f4b85509ff55c54589890924f138ce9 Mon Sep 17 00:00:00 2001 From: Luca Forstner Date: Mon, 13 Feb 2023 18:27:59 +0000 Subject: [PATCH 1/2] feat: Put `abs_path` into stack frame object --- packages/browser/src/stack-parsers.ts | 4 +- .../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 ++++++-- 9 files changed, 1504 insertions(+), 210 deletions(-) diff --git a/packages/browser/src/stack-parsers.ts b/packages/browser/src/stack-parsers.ts index d77bf0d901a2..6419f3660e9d 100644 --- a/packages/browser/src/stack-parsers.ts +++ b/packages/browser/src/stack-parsers.ts @@ -13,9 +13,9 @@ 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, - // All browser frames are considered in_app - in_app: true, + in_app: true, // All browser frames are considered in_app }; if (lineno !== undefined) { diff --git a/packages/browser/test/unit/tracekit/chromium.test.ts b/packages/browser/test/unit/tracekit/chromium.test.ts index b0df582ebeef..0d600cc28dd1 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', function: 'Array.forEach', in_app: true }] }, + stacktrace: { frames: [{ filename: 'native', abs_path: 'native', function: 'Array.forEach', in_app: true }] }, }); }); @@ -33,10 +33,38 @@ describe('Tracekit - Chrome Tests', () => { type: 'foo', stacktrace: { frames: [ - { 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 }, + { + 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, + }, ], }, }); @@ -62,6 +90,7 @@ 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, @@ -69,6 +98,7 @@ describe('Tracekit - Chrome Tests', () => { }, { filename: 'http://localhost:8080/file.js', + abs_path: 'http://localhost:8080/file.js', function: 'HTMLButtonElement.onclick', lineno: 107, colno: 146, @@ -76,6 +106,7 @@ describe('Tracekit - Chrome Tests', () => { }, { filename: 'http://localhost:8080/file.js', + abs_path: 'http://localhost:8080/file.js', function: 'dumpExceptionError', lineno: 41, colno: 27, @@ -108,6 +139,7 @@ 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, @@ -115,6 +147,7 @@ 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, @@ -122,6 +155,7 @@ 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, @@ -129,6 +163,7 @@ 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, @@ -159,11 +194,46 @@ describe('Tracekit - Chrome Tests', () => { type: 'Error', stacktrace: { frames: [ - { 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 }, + { + 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, + }, ], }, }); @@ -193,6 +263,7 @@ 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, @@ -200,6 +271,7 @@ 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, @@ -207,6 +279,7 @@ 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, @@ -214,6 +287,7 @@ 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, @@ -221,6 +295,7 @@ 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, @@ -228,12 +303,13 @@ 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', function: 'Error', in_app: true }, + { filename: 'native', abs_path: 'native', function: 'Error', in_app: true }, ], }, }); @@ -256,6 +332,7 @@ describe('Tracekit - Chrome Tests', () => { frames: [ { filename: 'examplescheme://examplehost/cd351f7250857e22ceaa.worker.js', + abs_path: 'examplescheme://examplehost/cd351f7250857e22ceaa.worker.js', function: '?', lineno: 70179, colno: 15, @@ -284,10 +361,31 @@ describe('Tracekit - Chrome Tests', () => { type: 'Error', stacktrace: { frames: [ - { 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 }, + { + 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, + }, ], }, }); @@ -317,16 +415,79 @@ describe('Tracekit - Chrome Tests', () => { type: 'Error', stacktrace: { frames: [ - { 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 }, + { + 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, + }, ], }, }); @@ -349,9 +510,30 @@ describe('Tracekit - Chrome Tests', () => { type: 'Error', stacktrace: { frames: [ - { 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 }, + { + 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, + }, ], }, }); @@ -375,10 +557,31 @@ describe('Tracekit - Chrome Tests', () => { type: 'Error', stacktrace: { frames: [ - { 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 }, + { + 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, + }, ], }, }); @@ -408,22 +611,72 @@ 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/', 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 }, + { + 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, + }, ], }, }); @@ -446,6 +699,7 @@ 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, @@ -478,6 +732,7 @@ 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, @@ -485,6 +740,7 @@ describe('Tracekit - Chrome Tests', () => { }, { filename: 'react-dom.development.js?f8c1', + abs_path: 'react-dom.development.js?f8c1', function: 'commitLifeCycles', in_app: true, lineno: 20663, @@ -492,6 +748,7 @@ describe('Tracekit - Chrome Tests', () => { }, { filename: 'genericDiscoverQuery.tsx?33f8', + abs_path: 'genericDiscoverQuery.tsx?33f8', function: '_GenericDiscoverQuery.componentDidMount', in_app: true, lineno: 152, @@ -499,6 +756,7 @@ describe('Tracekit - Chrome Tests', () => { }, { filename: 'genericDiscoverQuery.tsx?33f8', + abs_path: 'genericDiscoverQuery.tsx?33f8', function: '_GenericDiscoverQuery.eval [as fetchData]', in_app: true, lineno: 256, @@ -506,6 +764,7 @@ describe('Tracekit - Chrome Tests', () => { }, { filename: 'genericDiscoverQuery.tsx?33f8', + abs_path: 'genericDiscoverQuery.tsx?33f8', function: 'doDiscoverQuery', in_app: true, lineno: 328, @@ -513,6 +772,7 @@ describe('Tracekit - Chrome Tests', () => { }, { filename: 'api.tsx', + abs_path: 'api.tsx', function: 'Client.requestPromise', in_app: true, lineno: 554, @@ -542,9 +802,10 @@ describe('Tracekit - Chrome Tests', () => { type: 'ChunkLoadError', stacktrace: { frames: [ - { filename: '', function: 'Array.reduce', in_app: true }, + { filename: '', abs_path: '', function: 'Array.reduce', in_app: true }, { filename: 'webpack/runtime/ensure chunk', + abs_path: 'webpack/runtime/ensure chunk', function: '?', in_app: true, lineno: 6, @@ -552,6 +813,7 @@ describe('Tracekit - Chrome Tests', () => { }, { filename: 'webpack/runtime/jsonp chunk loading', + abs_path: 'webpack/runtime/jsonp chunk loading', function: 'key', in_app: true, lineno: 27, @@ -559,12 +821,15 @@ 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, }, @@ -592,8 +857,22 @@ describe('Tracekit - Chrome Tests', () => { type: 'Error', stacktrace: { frames: [ - { 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 }, + { + 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, + }, ], }, }); diff --git a/packages/browser/test/unit/tracekit/firefox.test.ts b/packages/browser/test/unit/tracekit/firefox.test.ts index f75dd7ccf010..ee21f4644648 100644 --- a/packages/browser/test/unit/tracekit/firefox.test.ts +++ b/packages/browser/test/unit/tracekit/firefox.test.ts @@ -26,13 +26,55 @@ describe('Tracekit - Firefox Tests', () => { type: 'TypeError', stacktrace: { frames: [ - { 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 }, + { + 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, + }, ], }, }); @@ -62,13 +104,55 @@ describe('Tracekit - Firefox Tests', () => { type: 'foo', stacktrace: { frames: [ - { 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 }, + { + 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, + }, ], }, }); @@ -94,9 +178,27 @@ describe('Tracekit - Firefox Tests', () => { type: 'foo', stacktrace: { frames: [ - { 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 }, + { + 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, + }, ], }, }); @@ -123,9 +225,30 @@ describe('Tracekit - Firefox Tests', () => { type: 'Error', stacktrace: { frames: [ - { 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 }, + { + 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, + }, ], }, }); @@ -158,11 +281,33 @@ describe('Tracekit - Firefox Tests', () => { type: 'NS_ERROR_FAILURE', stacktrace: { frames: [ - { 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: '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: '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, @@ -202,6 +348,7 @@ 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, @@ -209,6 +356,7 @@ 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, @@ -241,11 +389,43 @@ describe('Tracekit - Firefox Tests', () => { type: 'foo', stacktrace: { frames: [ - { 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 }, + { + 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, + }, ], }, }); @@ -267,9 +447,30 @@ describe('Tracekit - Firefox Tests', () => { type: 'Error', stacktrace: { frames: [ - { 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 }, + { + 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, + }, ], }, }); @@ -297,15 +498,77 @@ describe('Tracekit - Firefox Tests', () => { type: 'Error', stacktrace: { frames: [ - { 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 }, + { + 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, + }, ], }, }); @@ -332,6 +595,7 @@ describe('Tracekit - Firefox Tests', () => { { colno: 1018410, filename: 'https://www.random_website.com/main.4a4119c3cdfd10266d84.js', + abs_path: 'https://www.random_website.com/vendor.d1cae9cfc9917df88de7.js', function: 'handleProfileResult', in_app: true, lineno: 146, @@ -339,6 +603,7 @@ 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, @@ -346,6 +611,7 @@ 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 544542b0dcaf..6417a7043c32 100644 --- a/packages/browser/test/unit/tracekit/ie.test.ts +++ b/packages/browser/test/unit/tracekit/ie.test.ts @@ -23,9 +23,30 @@ describe('Tracekit - IE Tests', () => { type: 'foo', stacktrace: { frames: [ - { 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 }, + { + 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, + }, ], }, }); @@ -52,9 +73,30 @@ describe('Tracekit - IE Tests', () => { type: 'TypeError', stacktrace: { frames: [ - { 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 }, + { + 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, + }, ], }, }); @@ -80,9 +122,23 @@ describe('Tracekit - IE Tests', () => { type: 'ReferenceError', stacktrace: { frames: [ - { 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 }, + { + 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 }, ], }, }); diff --git a/packages/browser/test/unit/tracekit/misc.test.ts b/packages/browser/test/unit/tracekit/misc.test.ts index e9db457ea196..15720ff97374 100644 --- a/packages/browser/test/unit/tracekit/misc.test.ts +++ b/packages/browser/test/unit/tracekit/misc.test.ts @@ -19,9 +19,27 @@ describe('Tracekit - Misc Tests', () => { type: 'foo', stacktrace: { frames: [ - { 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 }, + { + 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: 'http:///path/to/file.js', + abs_path: 'http:///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 e86855dc172a..08d7119fb5bb 100644 --- a/packages/browser/test/unit/tracekit/opera.test.ts +++ b/packages/browser/test/unit/tracekit/opera.test.ts @@ -37,13 +37,55 @@ describe('Tracekit - Opera Tests', () => { type: 'foo', stacktrace: { frames: [ - { 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 }, + { + 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, + }, ], }, }); @@ -83,13 +125,62 @@ describe('Tracekit - Opera Tests', () => { type: 'foo', stacktrace: { frames: [ - { 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 }, + { + 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, + }, ], }, }); @@ -122,6 +213,7 @@ describe('Tracekit - Opera Tests', () => { frames: [ { filename: 'http://localhost:8000/ExceptionLab.html', + abs_path: 'http://localhost:8000/ExceptionLab.html', function: '', lineno: 1, colno: 0, @@ -129,6 +221,7 @@ describe('Tracekit - Opera Tests', () => { }, { filename: 'http://localhost:8000/ExceptionLab.html', + abs_path: 'http://localhost:8000/ExceptionLab.html', function: 'dumpException3', lineno: 46, colno: 8, @@ -136,6 +229,7 @@ describe('Tracekit - Opera Tests', () => { }, { filename: 'http://localhost:8000/ExceptionLab.html', + abs_path: 'http://localhost:8000/ExceptionLab.html', function: '', lineno: 48, colno: 12, @@ -164,9 +258,30 @@ describe('Tracekit - Opera Tests', () => { type: 'TypeError', stacktrace: { frames: [ - { 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 }, + { + 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, + }, ], }, }); diff --git a/packages/browser/test/unit/tracekit/react-native.test.ts b/packages/browser/test/unit/tracekit/react-native.test.ts index 9a74e46007b1..7615a27c4afe 100644 --- a/packages/browser/test/unit/tracekit/react-native.test.ts +++ b/packages/browser/test/unit/tracekit/react-native.test.ts @@ -22,18 +22,41 @@ 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, @@ -41,12 +64,20 @@ 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', function: 'Object.onPress', lineno: 2342, colno: 3773, in_app: true }, + { + filename: 'index.android.bundle', + abs_path: 'index.android.bundle', + function: 'Object.onPress', + lineno: 2342, + colno: 3773, + in_app: true, + }, ], }, }); @@ -69,10 +100,12 @@ describe('Tracekit - React Native Tests', () => { type: 'Error', stacktrace: { frames: [ - { filename: '[native code]', function: 'forEach', in_app: true }, + { filename: '[native code]', abs_path: '[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, @@ -81,6 +114,8 @@ 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, @@ -89,6 +124,8 @@ 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, @@ -97,6 +134,8 @@ 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, @@ -133,6 +172,8 @@ 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, @@ -141,6 +182,8 @@ 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, @@ -149,6 +192,8 @@ 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, @@ -157,6 +202,8 @@ 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, @@ -165,6 +212,8 @@ 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, @@ -173,6 +222,8 @@ 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, @@ -181,6 +232,8 @@ 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, @@ -188,6 +241,7 @@ 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, @@ -249,73 +303,260 @@ describe('Tracekit - React Native Tests', () => { type: 'Error', stacktrace: { frames: [ - { 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: '[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: '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]', 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: '[native code]', abs_path: '[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]', function: '?', in_app: true }, + { filename: '[native code]', abs_path: '[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', function: 'onPress', lineno: 12, colno: 2336, in_app: true }, - { filename: 'index.android.bundle', function: 'value', lineno: 12, colno: 1917, 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, + }, ], }, }); @@ -360,38 +601,168 @@ 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', function: 'anonymous', lineno: 1, colno: 224280, in_app: true }, - { filename: 'index.android.bundle', function: 'onPress', lineno: 1, colno: 452701, 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, + }, ], }, }); diff --git a/packages/browser/test/unit/tracekit/react.test.ts b/packages/browser/test/unit/tracekit/react.test.ts index d949a4dee0eb..5ebaa602ed06 100644 --- a/packages/browser/test/unit/tracekit/react.test.ts +++ b/packages/browser/test/unit/tracekit/react.test.ts @@ -23,9 +23,17 @@ describe('Tracekit - React Tests', () => { type: 'Invariant Violation', stacktrace: { frames: [ - { filename: 'http://localhost:5000/', function: 'f', lineno: 1, colno: 980, in_app: true }, + { + filename: 'http://localhost:5000/', + abs_path: '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, @@ -33,6 +41,7 @@ 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, @@ -40,6 +49,7 @@ 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, @@ -70,9 +80,17 @@ describe('Tracekit - React Tests', () => { type: 'Error', stacktrace: { frames: [ - { filename: 'http://localhost:5000/', function: 'f', lineno: 1, colno: 980, in_app: true }, + { + filename: 'http://localhost:5000/', + abs_path: '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, @@ -80,6 +98,7 @@ 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, @@ -87,6 +106,7 @@ 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, @@ -118,9 +138,17 @@ describe('Tracekit - React Tests', () => { type: 'Error', stacktrace: { frames: [ - { filename: 'http://localhost:5000/', function: 'f', lineno: 1, colno: 980, in_app: true }, + { + filename: 'http://localhost:5000/', + abs_path: '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, @@ -128,6 +156,7 @@ 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, @@ -135,6 +164,7 @@ 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 657ffc7daecc..c2ff37cdfe4c 100644 --- a/packages/browser/test/unit/tracekit/safari.test.ts +++ b/packages/browser/test/unit/tracekit/safari.test.ts @@ -22,10 +22,28 @@ describe('Tracekit - Safari Tests', () => { type: 'foo', stacktrace: { frames: [ - { 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 }, + { 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, + }, ], }, }); @@ -48,9 +66,30 @@ describe('Tracekit - Safari Tests', () => { type: 'TypeError', stacktrace: { frames: [ - { 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 }, + { + 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, + }, ], }, }); @@ -74,9 +113,30 @@ describe('Tracekit - Safari Tests', () => { type: 'TypeError', stacktrace: { frames: [ - { 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 }, + { + 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, + }, ], }, }); @@ -104,9 +164,23 @@ describe('Tracekit - Safari Tests', () => { type: 'ReferenceError', stacktrace: { frames: [ - { 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 }, + { + 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 }, ], }, }); @@ -131,6 +205,7 @@ 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, @@ -138,6 +213,7 @@ 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, @@ -163,9 +239,10 @@ describe('Tracekit - Safari Tests', () => { type: 'TypeError', stacktrace: { frames: [ - { filename: '[native code]', function: 'promiseReactionJob', in_app: true }, + { filename: '[native code]', abs_path: '[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, @@ -173,6 +250,7 @@ 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, @@ -201,6 +279,7 @@ 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, @@ -208,6 +287,7 @@ 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, @@ -233,9 +313,10 @@ describe('Tracekit - Safari Tests', () => { type: 'TypeError', stacktrace: { frames: [ - { filename: '[native code]', function: 'promiseReactionJob', in_app: true }, + { filename: '[native code]', abs_path: '[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, @@ -243,6 +324,7 @@ 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, @@ -271,10 +353,31 @@ describe('Tracekit - Safari Tests', () => { type: 'Error', stacktrace: { frames: [ - { 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 }, + { + 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, + }, ], }, }); @@ -305,17 +408,73 @@ describe('Tracekit - Safari Tests', () => { type: 'Error', stacktrace: { frames: [ - { 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 }, + { + 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, + }, ], }, }); From 9c406daa747ac6a195d121f0186ee2967885d259 Mon Sep 17 00:00:00 2001 From: Luca Forstner Date: Mon, 13 Feb 2023 20:03:24 +0000 Subject: [PATCH 2/2] . --- packages/browser/test/unit/tracekit/firefox.test.ts | 2 +- packages/browser/test/unit/tracekit/misc.test.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/browser/test/unit/tracekit/firefox.test.ts b/packages/browser/test/unit/tracekit/firefox.test.ts index ee21f4644648..9a062d0a123b 100644 --- a/packages/browser/test/unit/tracekit/firefox.test.ts +++ b/packages/browser/test/unit/tracekit/firefox.test.ts @@ -595,7 +595,7 @@ describe('Tracekit - Firefox Tests', () => { { colno: 1018410, filename: 'https://www.random_website.com/main.4a4119c3cdfd10266d84.js', - abs_path: 'https://www.random_website.com/vendor.d1cae9cfc9917df88de7.js', + abs_path: 'https://www.random_website.com/main.4a4119c3cdfd10266d84.js', function: 'handleProfileResult', in_app: true, lineno: 146, diff --git a/packages/browser/test/unit/tracekit/misc.test.ts b/packages/browser/test/unit/tracekit/misc.test.ts index 15720ff97374..dbe718c9410f 100644 --- a/packages/browser/test/unit/tracekit/misc.test.ts +++ b/packages/browser/test/unit/tracekit/misc.test.ts @@ -34,8 +34,8 @@ describe('Tracekit - Misc Tests', () => { in_app: true, }, { - filename: 'http:///path/to/file.js', - abs_path: 'http:///path/to/file.js', + filename: 'file:///path/to/file.js', + abs_path: 'file:///path/to/file.js', function: '?', lineno: 878, in_app: true,