Repository navigation
fix: email validation for braze - #2929
Conversation
|
Important Auto Review SkippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the To trigger a single review, invoke the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on X ? TipsChat with CodeRabbit Bot (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## hotfix/Dec.18 #2929 +/- ##
==============================================
Coverage 87.27% 87.27%
==============================================
Files 790 790
Lines 29211 29217 +6
Branches 6831 6834 +3
==============================================
+ Hits 25494 25500 +6
Misses 3373 3373
Partials 344 344 ☔ View full report in Codecov by Sentry. |
| // if email is not string remove it from attributes | ||
| if (destKey === 'email' && typeof value !== 'string') { | ||
| throw new InstrumentationError('Invalid email, email must be a valid string'); | ||
| if (destKey === 'email' && Number.isInteger(value)) { |
There was a problem hiding this comment.
switch (destKey) {
case 'gender':
value = formatGender(value);
break;
case 'email':
if (typeof value === 'string') {
value = value.toLowerCase();
} else if (value !== null){
throw new InstrumentationError('Invalid email, email must be a valid string');
}
break;
default:
break;
}What about this?
There was a problem hiding this comment.
if v is null ..then our first check v!== 'string' will be true and gives NPE...we will never go to else if condition
|
| "_update_existing_only": false, | ||
| "city": "Disney", | ||
| "country": "USA", | ||
| "email": null, |
There was a problem hiding this comment.
Email is still coming as null
There was a problem hiding this comment.
we want to allow email as this is reserved keys and should pass as it is.
There was a problem hiding this comment.
earlier code if (value || (value === null && reservedKeys.includes(destKey))) { ... is checking against reservedKeys ..even if it is null
* fix: tiktok remove lowercasing for custom events (#2930) * fix: email validation for braze (#2929) * fix: addressed comments * fix: pinterest event value is restricted to string (#2933) * fix: converting event names to string before lowercasing * fix: small edit and adding test cases * fix: small edit and adding test cases * fix: remove log from dcm_floodlight (#2934) * chore(release): 1.52.3 --------- Co-authored-by: Anant Jain <[email protected]> Co-authored-by: AASHISH MALIK <[email protected]> Co-authored-by: shrouti1507 <[email protected]> Co-authored-by: Sankeerth <[email protected]> Co-authored-by: GitHub Actions <[email protected]>

What are the changes introduced in this PR?
email validation for braze if integer or obj
Write a brief explainer on your code changes.
Please explain the objectives of your changes below
Put down any required details on the broader aspect of your changes. If there are any dependent changes, mandatorily mention them here
Type of change
If the pull request is a bug-fix, enhancement or a refactor, please fill in the details on the changes made.
Existing capabilities/behavior
New capabilities/behavior
If the pull request is a new feature,
Any technical or performance related pointers to consider with the change?
N/A
Any new dependencies introduced with this change?
N/A
Any new generic utility introduced or modified. Please explain the changes.
N/A
If the PR has changes in more than 10 files, please mention why the changes were not split into multiple PRs.
N/A
If multiple linear tasks are associated with the PR changes, please elaborate on the reason:
N/A
Developer checklist
No breaking changes are being introduced.
Are all related docs linked with the PR?
Are all changes manually tested?
Does this change require any documentation changes?
Are relevant unit and component test-cases added?
Reviewer checklist
Is the type of change in the PR title appropriate as per the changes?
Verified that there are no credentials or confidential data exposed with the changes.