fix(snaptshot): Ensure attr.name is defined when collecting element attributes#160
Merged
fix(snaptshot): Ensure attr.name is defined when collecting element attributes#160
attr.name is defined when collecting element attributes#160Conversation
Lms24
commented
Jan 23, 2024
| // Looks like `attr.name` can be undefined although the types say differently | ||
| // see: https://github.com/getsentry/sentry-javascript/issues/10292 | ||
| if (attr.name && !ignoreAttribute(tagName, attr.name, attr.value)) { | ||
| attributes[attr.name] = transformAttribute( |
Member
Author
There was a problem hiding this comment.
just noticed this: Should we also lower-case the attribute here?
Member
There was a problem hiding this comment.
I would leave as-is, seems like a risky change. Just looked around and see that we do access keys that are now lower cased: https://github.com/getsentry/rrweb/pull/160/files#diff-6434d77e679a3d1e4217dcad03ee6f02551e41dc0b077a06a45020e68e1b4ee3L911
size-limit report 📦
|
3 tasks
billyvg
approved these changes
Jan 24, 2024
billyvg
pushed a commit
that referenced
this pull request
Jan 30, 2024
… attributes (#160) Probably fixes getsentry/sentry-javascript#10292 Not sure how `attr.name` could be undefined here but according to the issue, it happens and we should probably guard adding the attribute.
billyvg
pushed a commit
that referenced
this pull request
Apr 26, 2024
… attributes (#160) Probably fixes getsentry/sentry-javascript#10292 Not sure how `attr.name` could be undefined here but according to the issue, it happens and we should probably guard adding the attribute.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Probably fixes getsentry/sentry-javascript#10292
Not sure how
attr.namecould be undefined here but according to the issue, it happens and we should probably guard adding the attribute.Open question (see my comment)