Skip to content

Commit a8cf899

Browse files
authored
ref(replay): Streamline rrweb internal error check (#9391)
I think we don't really need this anymore, and this doesn't even work anyhow in any minified scenario, so we can safe these bundle bytes & also the work to check this on each error. Or @billyvg do you see scenarios where this would catch something that the check above wouldn't? 🤔
1 parent ddbda3c commit a8cf899

File tree

2 files changed

+1
-46
lines changed

2 files changed

+1
-46
lines changed

packages/replay/src/util/isRrwebError.ts

+1-8
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,5 @@ export function isRrwebError(event: Event, hint: EventHint): boolean {
1313
return true;
1414
}
1515

16-
// Check if any exception originates from rrweb
17-
return event.exception.values.some(exception => {
18-
if (!exception.stacktrace || !exception.stacktrace.frames || !exception.stacktrace.frames.length) {
19-
return false;
20-
}
21-
22-
return exception.stacktrace.frames.some(frame => frame.filename && frame.filename.includes('/rrweb/src/'));
23-
});
16+
return false;
2417
}

packages/replay/test/integration/coreHandlers/handleGlobalEvent.test.ts

-38
Original file line numberDiff line numberDiff line change
@@ -267,44 +267,6 @@ describe('Integration | coreHandlers | handleGlobalEvent', () => {
267267
expect(handleGlobalEventListener(replay)(errorEvent, {})).toEqual(errorEvent);
268268
});
269269

270-
it('skips rrweb internal errors', () => {
271-
const errorEvent: Event = {
272-
exception: {
273-
values: [
274-
{
275-
type: 'TypeError',
276-
value: "Cannot read properties of undefined (reading 'contains')",
277-
stacktrace: {
278-
frames: [
279-
{
280-
filename:
281-
'http://example.com/..node_modules/packages/replay/build/npm/esm/node_modules/rrweb/es/rrweb/packages/rrweb/src/record/mutation.js?v=90704e8a',
282-
function: 'MutationBuffer.processMutations',
283-
in_app: true,
284-
lineno: 101,
285-
colno: 23,
286-
},
287-
{
288-
filename: '<anonymous>',
289-
function: 'Array.forEach',
290-
in_app: true,
291-
},
292-
],
293-
},
294-
mechanism: {
295-
type: 'generic',
296-
handled: true,
297-
},
298-
},
299-
],
300-
},
301-
level: 'error',
302-
event_id: 'ff1616b1e13744c6964281349aecc82a',
303-
};
304-
305-
expect(handleGlobalEventListener(replay)(errorEvent, {})).toEqual(null);
306-
});
307-
308270
it('skips exception with __rrweb__ set', () => {
309271
const errorEvent: Event = {
310272
exception: {

0 commit comments

Comments
 (0)