-
Notifications
You must be signed in to change notification settings - Fork 15
fix: handle CSS-escaped form IDs in form vitals extraction #1272
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
base: main
Are you sure you want to change the base?
Conversation
| // counts metrics per each group | ||
| const match = source.match(/form[#.](\w+)/); | ||
| // Unescape CSS escape sequences (e.g., \35 -> 5) | ||
| const unescapedSource = source.replace(/\\([0-9a-fA-F]{1,6})\s?/g, (_, hex) => String.fromCharCode(parseInt(hex, 16))); |
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.
can you share an example please, where did you encounter this.
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.
can you confirm if the document.querySelector works after this change ?
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.
@05rahulsingh
Example:
form has id 5464aa16
form source in rum data: #container-a89bac44d9 form#\\35 464aa16
hence the regex here doesn't match and the formSource is not sent ahead.
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.
@vdua I checked querySelector doesn't work after this change, fixing it in few.
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.
@vdua I have changed the regex only to match both sourceIDs with or without hexadecimal number
|
This PR will trigger a patch release when merged. |
d1ba9f7 to
36a7f21
Compare
Please ensure your pull request adheres to the following guidelines:
Related Issues
Thanks for contributing!
JIRA: https://jira.corp.adobe.com/browse/FORMS-23719