@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.
@@ -12824,16 +12824,6 @@ class Replayer {
12824
12824
  ...this.legacy_missingNodeRetryMap
12825
12825
  };
12826
12826
  const queue = [];
12827
- const nextNotInDOM = (mutation) => {
12828
- let next = null;
12829
- if (mutation.nextId) {
12830
- next = mirror2.getNode(mutation.nextId);
12831
- }
12832
- if (mutation.nextId !== null && mutation.nextId !== void 0 && mutation.nextId !== -1 && !next) {
12833
- return true;
12834
- }
12835
- return false;
12836
- };
12837
12827
  const appendNode = (mutation) => {
12838
12828
  var _a2, _b2;
12839
12829
  if (!this.iframe.contentDocument) {
@@ -12846,7 +12836,10 @@ class Replayer {
12846
12836
  if (mutation.node.type === NodeType.Document) {
12847
12837
  return this.newDocumentQueue.push(mutation);
12848
12838
  }
12849
- return queue.push(mutation);
12839
+ const parentIdInCurrentBatch = d.adds.some(
12840
+ (add) => add.node.id === mutation.parentId
12841
+ );
12842
+ return parentIdInCurrentBatch ? queue.push(mutation) : void 0;
12850
12843
  }
12851
12844
  if (mutation.node.isShadow) {
12852
12845
  if (!hasShadowRoot(parent)) {
@@ -12862,9 +12855,6 @@ class Replayer {
12862
12855
  if (mutation.nextId) {
12863
12856
  next = mirror2.getNode(mutation.nextId);
12864
12857
  }
12865
- if (nextNotInDOM(mutation)) {
12866
- return queue.push(mutation);
12867
- }
12868
12858
  if (mutation.node.rootId && !mirror2.getNode(mutation.node.rootId)) {
12869
12859
  return;
12870
12860
  }
@@ -12970,11 +12960,11 @@ class Replayer {
12970
12960
  d.adds.forEach((mutation) => {
12971
12961
  appendNode(mutation);
12972
12962
  });
12973
- const startTime = Date.now();
12963
+ const startTime = performance.now();
12974
12964
  while (queue.length) {
12975
12965
  const resolveTrees = queueToResolveTrees(queue);
12976
12966
  queue.length = 0;
12977
- if (Date.now() - startTime > 500) {
12967
+ if (performance.now() - startTime > 150) {
12978
12968
  this.warn(
12979
12969
  "Timeout in the loop, please check the resolve tree data:",
12980
12970
  resolveTrees