From 7c2d04cbb50beac75a1f769ff2b0e186315b51d8 Mon Sep 17 00:00:00 2001 From: Justin Halsall Date: Wed, 1 Apr 2026 12:00:00 +0800 Subject: [PATCH] add idRemoved to TreeIndex (#640) --- src/replay/index.ts | 4 ++-- src/utils.ts | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/replay/index.ts b/src/replay/index.ts index a15e3451..5707feb2 100644 --- a/src/replay/index.ts +++ b/src/replay/index.ts @@ -1619,7 +1619,7 @@ export class Replayer { } private warnNodeNotFound(d: incrementalData, id: number) { - if (this.treeIndex['removeIdSet'].has(id)) { + if (this.treeIndex.idRemoved(id)) { this.warn(`Node with id '${id}' was previously removed. `, d); } else { this.warn(`Node with id '${id}' not found. `, d); @@ -1641,7 +1641,7 @@ export class Replayer { * is microtask, so events fired on a removed DOM may emit * snapshots in the reverse order. */ - if (this.treeIndex['removeIdSet'].has(id)) { + if (this.treeIndex.idRemoved(id)) { this.debug( REPLAY_CONSOLE_PREFIX, `Node with id '${id}' was previously removed. `, diff --git a/src/utils.ts b/src/utils.ts index 88f4f7dc..fcad16e8 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -534,6 +534,10 @@ export class TreeIndex { this.scrollMap = new Map(); this.inputMap = new Map(); } + + public idRemoved(id: number): boolean { + return this.removeIdSet.has(id); + } } type ResolveTree = {