-
Notifications
You must be signed in to change notification settings - Fork 1
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
AMP-101866 textarea serialization fix #25
AMP-101866 textarea serialization fix #25
Conversation
* Fix serialization and mutation of <textarea> elements taking account the duality that the value can be set in either the child node, or in the value _parameter_ (not attribute) * Backwards compatibility: Bug fix and regression test for rrweb-io#112 - this is to fix up 'historical' recordings, as duplicate textarea content should no longer be being created at record time - new test shows what the snapshot generated by previous versions of rrweb used to look like, hence 'bad' - original 0efe23f fix either didn't work or no longer works due to childNodes being appended subsequent to this part of the code - during review, we also verified that the `_cssText` case should still be handled okay, as there's currently no scenario where csstext is present with css child nodes of a <style> * Masking: Fix that textarea values were being missed by the masking system if the value was recorded as a child node - I didn't notice that form.html was used in other tests, so lucky that I noticed that those tests also should have the 'pre value' masked out * Simplify by always storing the textarea value in the `.value` attribute (from it's DOM property) and not as a childNode. It should still be rebuilt as a childNode rather than a property --------- Authored-by: eoghanmurray <[email protected]>
🦋 Changeset detectedLatest commit: fb39603 The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 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 |
.changeset/moody-dots-refuse.md
Outdated
@@ -0,0 +1,5 @@ | |||
--- | |||
'rrweb': patch |
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.
Need to change to @amplitude/rrweb
Should try and test before releasing at least on SR SDK side. |
@jxiwang so the replay I linked was using this new patch. Though I hadn't tested for regressions. I can run the playwright scripts I have against the tasks app though before merging. Also I wasn't sure if you had anything specific to look out for. |
Pulls in a nice fix around textarea serialization from upstream. This should prevent duplicate values in textareas.
Example replay:
https://app.amplitude.com/analytics/amplitude/session-replay/project/626195/search/amplitude_id%3D956525072689?sessionHandle=ZEOcNRF_ZEOcNRF_N61VlEx_CY4T_99f59631-290b-4960-a509-3a4d757f69b2&sessionReplayId=99f59631-290b-4960-a509-3a4d757f69b2/1722524161093&sessionLength=9414&sessionStartTime=1722524161093&deviceType=&user_id=&country=United%20States