@posthog/rrweb 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.
@@ -17071,16 +17071,6 @@ class Replayer {
17071
17071
  });
17072
17072
  const legacy_missingNodeMap = __spreadValues({}, this.legacy_missingNodeRetryMap);
17073
17073
  const queue = [];
17074
- const nextNotInDOM = (mutation) => {
17075
- let next = null;
17076
- if (mutation.nextId) {
17077
- next = mirror2.getNode(mutation.nextId);
17078
- }
17079
- if (mutation.nextId !== null && mutation.nextId !== void 0 && mutation.nextId !== -1 && !next) {
17080
- return true;
17081
- }
17082
- return false;
17083
- };
17084
17074
  const appendNode = (mutation) => {
17085
17075
  var _a2, _b;
17086
17076
  if (!this.iframe.contentDocument) {
@@ -17093,7 +17083,10 @@ class Replayer {
17093
17083
  if (mutation.node.type === NodeType.Document) {
17094
17084
  return this.newDocumentQueue.push(mutation);
17095
17085
  }
17096
- return queue.push(mutation);
17086
+ const parentIdInCurrentBatch = d.adds.some(
17087
+ (add) => add.node.id === mutation.parentId
17088
+ );
17089
+ return parentIdInCurrentBatch ? queue.push(mutation) : void 0;
17097
17090
  }
17098
17091
  if (mutation.node.isShadow) {
17099
17092
  if (!hasShadowRoot(parent)) {
@@ -17109,9 +17102,6 @@ class Replayer {
17109
17102
  if (mutation.nextId) {
17110
17103
  next = mirror2.getNode(mutation.nextId);
17111
17104
  }
17112
- if (nextNotInDOM(mutation)) {
17113
- return queue.push(mutation);
17114
- }
17115
17105
  if (mutation.node.rootId && !mirror2.getNode(mutation.node.rootId)) {
17116
17106
  return;
17117
17107
  }
@@ -17217,11 +17207,11 @@ class Replayer {
17217
17207
  d.adds.forEach((mutation) => {
17218
17208
  appendNode(mutation);
17219
17209
  });
17220
- const startTime = Date.now();
17210
+ const startTime = performance.now();
17221
17211
  while (queue.length) {
17222
17212
  const resolveTrees = queueToResolveTrees(queue);
17223
17213
  queue.length = 0;
17224
- if (Date.now() - startTime > 500) {
17214
+ if (performance.now() - startTime > 150) {
17225
17215
  this.warn(
17226
17216
  "Timeout in the loop, please check the resolve tree data:",
17227
17217
  resolveTrees