c18626bf5ae31f1abc6d5268651bd3d8696cc610
This change include two critical fix for both recorder and replayer. In the recorder, previously we filter text and attribute mutations by check its target id, but this was a wrong approach because removed node also has id at the callback moment. We corrected this by checking whether the mirror map still has the target id in its keys. In the replayer side, the issue was we got exceptions when calling insertBefore which says the ref node was not the child node of the caller node. This will happen when the previous or next sibling has been removed in the same callback but the previousId or nextId was recorded. After apply remove node mutations before add node mutations, we can make sure the removed siblings will not exist in the mirror map when apply add node mutations. When we get node from mirror map with an removed id, we will get null and pass it to insertBefore which is valid. As a side note, this apply order is safe because we ensured all the remove node mutations do not include removing newly added nodes in the same callback.
rrweb
Not ready yet
Languages
TypeScript
66.5%
JavaScript
25.8%
HTML
6.3%
Svelte
1.2%
CSS
0.2%