From d5fd6041ce77cf61d8e6b9ffddc0ce01181ae068 Mon Sep 17 00:00:00 2001 From: Blake Byrnes Date: Thu, 13 Jan 2022 17:45:52 -0500 Subject: [PATCH] fix(core): don't record removal of donottrack --- core/injected-scripts/pageEventsRecorder.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/core/injected-scripts/pageEventsRecorder.ts b/core/injected-scripts/pageEventsRecorder.ts index 2befe66cf..ca3b7ced2 100644 --- a/core/injected-scripts/pageEventsRecorder.ts +++ b/core/injected-scripts/pageEventsRecorder.ts @@ -625,11 +625,6 @@ class PageEventsRecorder { if (action === DomActionType.added) { this.nodeIdToParentNodeId[serial.id] = serial.parentNodeId; - // don't include this if it's hero id - if (this.doNotTrackElementsById.has(serial.id)) { - return; - } - if (this.doNotTrackElementsById.has(serial.previousSiblingId)) { // get previous node that's tracked let previousNode: ChildNode = this.doNotTrackElementsById.get(serial.previousSiblingId); @@ -641,6 +636,10 @@ class PageEventsRecorder { serial.previousSiblingId = nodeId; } } + // don't include this if it's hero id + if (this.doNotTrackElementsById.has(serial.id)) { + return; + } this.domChanges.push([action, serial, timestamp, idx()]); } }