From 322a00daacded6bbb3232c7bde059f22b2d5b0bf Mon Sep 17 00:00:00 2001 From: Billy Vong Date: Thu, 16 Mar 2023 17:25:33 -0400 Subject: [PATCH] feat(replay): Check for node existance in mirror before appending For some reason we have some recordings that have duplicated node ids. Not sure how widespread this is, but lets check for dupes before appending a mutation. --- packages/rrweb/src/replay/index.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/rrweb/src/replay/index.ts b/packages/rrweb/src/replay/index.ts index 514f2f1f6c..23ca71095f 100644 --- a/packages/rrweb/src/replay/index.ts +++ b/packages/rrweb/src/replay/index.ts @@ -1406,6 +1406,12 @@ export class Replayer { return queue.push(mutation); } + // TODO(sentry): We are seeing duplicated node ids in our recording + // Handling this in the replayer while we look for root cause in recorder + if (this.mirror.getNode(mutation.node.id)) { + return; + } + let parentInDocument = null; if (this.iframe.contentDocument.contains) { parentInDocument = this.iframe.contentDocument.contains(parent);