@posthog/rrweb-player 0.0.22 → 0.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12826,16 +12826,6 @@ class Replayer {
12826
12826
  ...this.legacy_missingNodeRetryMap
12827
12827
  };
12828
12828
  const queue = [];
12829
- const nextNotInDOM = (mutation) => {
12830
- let next = null;
12831
- if (mutation.nextId) {
12832
- next = mirror2.getNode(mutation.nextId);
12833
- }
12834
- if (mutation.nextId !== null && mutation.nextId !== void 0 && mutation.nextId !== -1 && !next) {
12835
- return true;
12836
- }
12837
- return false;
12838
- };
12839
12829
  const appendNode = (mutation) => {
12840
12830
  var _a2, _b2;
12841
12831
  if (!this.iframe.contentDocument) {
@@ -12848,7 +12838,10 @@ class Replayer {
12848
12838
  if (mutation.node.type === NodeType.Document) {
12849
12839
  return this.newDocumentQueue.push(mutation);
12850
12840
  }
12851
- return queue.push(mutation);
12841
+ const parentIdInCurrentBatch = d.adds.some(
12842
+ (add) => add.node.id === mutation.parentId
12843
+ );
12844
+ return parentIdInCurrentBatch ? queue.push(mutation) : void 0;
12852
12845
  }
12853
12846
  if (mutation.node.isShadow) {
12854
12847
  if (!hasShadowRoot(parent)) {
@@ -12864,9 +12857,6 @@ class Replayer {
12864
12857
  if (mutation.nextId) {
12865
12858
  next = mirror2.getNode(mutation.nextId);
12866
12859
  }
12867
- if (nextNotInDOM(mutation)) {
12868
- return queue.push(mutation);
12869
- }
12870
12860
  if (mutation.node.rootId && !mirror2.getNode(mutation.node.rootId)) {
12871
12861
  return;
12872
12862
  }
@@ -12972,11 +12962,11 @@ class Replayer {
12972
12962
  d.adds.forEach((mutation) => {
12973
12963
  appendNode(mutation);
12974
12964
  });
12975
- const startTime = Date.now();
12965
+ const startTime = performance.now();
12976
12966
  while (queue.length) {
12977
12967
  const resolveTrees = queueToResolveTrees(queue);
12978
12968
  queue.length = 0;
12979
- if (Date.now() - startTime > 500) {
12969
+ if (performance.now() - startTime > 150) {
12980
12970
  this.warn(
12981
12971
  "Timeout in the loop, please check the resolve tree data:",
12982
12972
  resolveTrees