Skip to content
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

replay: set data-dd-privacy attribute on snapshot node if hidden #726

Merged

Conversation

vlad-mh
Copy link
Contributor

@vlad-mh vlad-mh commented Feb 9, 2021

This PR is a follow up on #715

As a node can be hidden from a data attribute rather than a class,
only adding the class to the snapshot node attributes means we can't
properly style the node when rebuilding it.

This PR ensures the data-dd-privacy=hidden attribute is always
set, even if the node was hidden using the class.

Additionally, we set the ID as a/ it helps with testing, b/ we can
assume it doesn't contain PII and c/ it may be used when
rebuilding (CSS rules could be selecting by ID).

@vlad-mh vlad-mh requested a review from a team as a code owner February 9, 2021 11:25
@BenoitZugmeyer
Copy link
Member

NIT: I kind of think a unit test would be better for this change, but the e2e test may be enough

As a node can be hidden from a data attribute rather than a class,
only adding the class to the snapshot node attributes means we can't
properly style the node when rebuilding it.

This commit ensures the data-dd-privacy=hidden attribute is always
set, even if the node was hidden using the class.

Additionally, we set the ID as a/ it helps with testing, b/ we can
assume it doesn't contain PII and c/ it may be used when
rebuilding (CSS rules could be selecting by ID).
@vlad-mh vlad-mh force-pushed the vlad/rum-replay-privacy-set-attributes-on-snapshot-node branch from dc1ff2d to bf3f7cd Compare February 10, 2021 11:03
@vlad-mh vlad-mh merged commit ce55e19 into master Feb 10, 2021
webNeat pushed a commit that referenced this pull request Feb 15, 2021
As a node can be hidden from a data attribute rather than a class,
only adding the class to the snapshot node attributes means we can't
properly style the node when rebuilding it.

This commit ensures the data-dd-privacy=hidden attribute is always
set, even if the node was hidden using the class.

Additionally, we set the ID as a/ it helps with testing, b/ we can
assume it doesn't contain PII and c/ it may be used when
rebuilding (CSS rules could be selecting by ID).
@bcaudan bcaudan deleted the vlad/rum-replay-privacy-set-attributes-on-snapshot-node branch May 5, 2021 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants