-
-
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
Handle negative ids in rrdom correctly + extra tests #927
Conversation
…lize-stylesheet-contents
…web-io/rrweb into serialize-stylesheet-contents
…lize-stylesheet-contents
…/rrweb into inline-image-test-cases
…e-image-test-cases
When iframes get inserted they create untracked elements, both on the dom and rrdom side. Because they are untracked they generate negative numbers when fetching the id from mirror. This creates a problem when comparing and fetching ids across mirrors. This commit tries to get away from using negative ids as much as possible in rrdom's comparisons
Is this PR also a fix for #917? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The negative ids part looks good to me.
Co-authored-by: Yun Feng <yun.feng@anu.edu.au>
@Mark-Fenng I don't think so, I tried replaying the JSON Blobs on my branch and on rrwebdebug and they look the same. |
This way we don't accidentally think of them as mirror misses
I set the first unserialised id to be -2 so its clear when an id gets returned from the mirror if it is a mirror miss or an unserialised id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Congrats, you figured out the method to fix the test failure. Your solution also looks good.
Thanks @Mark-Fenng! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice patch! Let's merge this after a rebase.
When iframes get inserted they create untracked elements, both on the dom and rrdom side.
Because they are untracked they generate negative numbers when fetching the id from mirror.
This creates a problem when comparing and fetching ids across mirrors.
This PR tries to get away from using negative ids as much as possible in rrdom's comparisons.
PR also adds more test coverage for inlining images.
Also fixes recording of iframe mutations once the page gets reloaded