-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Switch to real dom before rebuilding fullsnapshot #1139
Conversation
🦋 Changeset detectedLatest commit: d63cc1e The changes in this PR will be included in the next version bump. This PR includes changesets to release 7 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
By setting usingVirtualDom to false, aren’t you essentially turning off all rrdom/virtual dom optimizations whenever you hit a full snapshot? |
Yes, because if a new fullsnapshot is rebuilt, the status of the existing virtual dom doesn't mean anything as it represents the previous snapshot. Virtual dom optimization shall only be activated if there are incremental node mutations. Refer to the code: https://github.com/rrweb-io/rrweb/blob/master/packages/rrweb/src/replay/index.ts#L1340-L1343 This pull request won't change any logic for correct event data. It is made for data with flaws. Previous parentFragment optimization can tolerate those flaws. So I think the new version should also have the capability. |
If a rrnode appends the same child twice, the child nodes will become an infinite linked list
63b53c6
to
d63cc1e
Compare
For future work: I feel like the |
Your suggestion can also help. I think if this pull request is merged, there are not many serious bugs left. |
This pull request makes rrdom optimization robust.
Normally rebuilding full snapshots should not be under a virtual dom environment.
But if the order of data events has some issues, it might be possible.
Adding a check to avoid any potential issues.
Fix the bug: If an RRNode appends the same child twice, the child nodes will become an infinite linked list. This is a bug imported in improve rrdom performance #1127