fix: [M3-7078] codeQL warning with analytics.ts#9700
Merged
abailly-akamai merged 3 commits intolinode:developfrom Sep 22, 2023
Merged
fix: [M3-7078] codeQL warning with analytics.ts#9700abailly-akamai merged 3 commits intolinode:developfrom
abailly-akamai merged 3 commits intolinode:developfrom
Conversation
Contributor
Author
|
@dwiley-akamai I don't think so and couldn't find a reference to extra in the docs and elsewhere. It should be noted that the pipe delimiter in custom events does is already a bit of an edge case we document (we are the ones defining those). |
bnussman-akamai
requested changes
Sep 20, 2023
mjac0bs
approved these changes
Sep 20, 2023
Contributor
mjac0bs
left a comment
There was a problem hiding this comment.
Thanks for the improvements!
Yeah. | is an edge case of our own because of the way that our Analytics team is reading and delimiting these custom event attributes in Adobe, and so while we should avoid introducing pipes into our custom events in the first place, it's great to fix the warning and correctly prevent developer error.
Comment on lines
+30
to
+32
| action: eventPayload.action.replace(/\|/g, ''), | ||
| category: eventPayload.category.replace(/\|/g, ''), | ||
| label: eventPayload.label?.replace(/\|/g, ''), |
Comment on lines
+10
to
+12
| type DTMSatellite = { | ||
| track: (eventName: string, eventPayload: AnalyticsEvent) => void; | ||
| }; |
bnussman-akamai
approved these changes
Sep 21, 2023
Member
bnussman-akamai
left a comment
There was a problem hiding this comment.
I confirmed that the .replace works! ✅
Nice improvement to the types!
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.




Description 📝
This pr fixes this codeQL warning and type the _satellite object a bit better
Major Changes 🔄
eventPayloadreplaced values|are replaced (as opposed to one before)How to test 🧪
Setup:
Steps:
|(pipe) characters