Skip to content

Commit

Permalink
Fix: Switch to real dom before rebuilding fullsnapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
YunFeng0817 committed Feb 16, 2023
1 parent f6f07e9 commit af57732
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/eight-terms-hunt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'rrweb': patch
---

Fix: Switch from virtual dom to real dom before rebuilding fullsnapshot
10 changes: 10 additions & 0 deletions packages/rrweb/src/replay/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,16 @@ export class Replayer {
}
};

/**
* Normally rebuilding full snapshot should not be under virtual dom environment.
* But if the order of data events has some issues, it might be possible.
* Adding this check to avoid any potential issues.
*/
if (this.usingVirtualDom) {
this.virtualDom.destroyTree();
this.usingVirtualDom = false;
}

this.mirror.reset();
rebuild(event.data.node, {
doc: this.iframe.contentDocument,
Expand Down

0 comments on commit af57732

Please sign in to comment.