-
Notifications
You must be signed in to change notification settings - Fork 6
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
fix(snaptshot): Ensure attr.name
is defined when collecting element attributes
#160
Conversation
if (!ignoreAttribute(tagName, attr.name, attr.value)) { | ||
// 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( |
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.
just noticed this: Should we also lower-case the attribute here?
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.
not sure 🤔 cc @billyvg ?
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.
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 📦
|
… 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.
… 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.
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.Open question (see my comment)