-
Notifications
You must be signed in to change notification settings - Fork 114
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: bug fix for track event #2852
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 WalkthroughThe changes involve updates to the Changes
Assessment against linked issues
Poem
TipsChat with CodeRabbit Bot (
|
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.
Review Status
Actionable comments generated: 4
Configuration used: CodeRabbit UI
Files selected for processing (1)
- src/v0/destinations/sfmc/transform.js (4 hunks)
Additional comments: 1
src/v0/destinations/sfmc/transform.js (1)
- 3-8: The addition of
isDefinedAndNotNull
andisEmpty
to the imports suggests that these utility functions will be used for validation checks in the code.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## develop #2852 +/- ##
========================================
Coverage 87.16% 87.17%
========================================
Files 772 772
Lines 28788 28794 +6
Branches 6764 6767 +3
========================================
+ Hits 25094 25100 +6
Misses 3351 3351
Partials 343 343 ☔ View full report in Codecov by Sentry. |
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- src/v0/destinations/sfmc/transform.js (4 hunks)
Additional comments: 2
src/v0/destinations/sfmc/transform.js (2)
225-237: The changes made to the
responseBuilderSimple
function for additional validation ofmessage.event
are correctly implemented and align with the summary provided. The error messages are also more specific, which will aid in troubleshooting.250-250: The updated error message for unsupported event types is more informative and user-friendly, which aligns with the summary provided.
The issue is already fixed as part of #2846. But if there is anything we are doing extra, please feel free to ignore the mentioned PR with this one |
@sanpj2292 I added some validations in case |
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.
Review Status
Actionable comments generated: 4
Configuration used: CodeRabbit UI
Files selected for processing (2)
- src/v0/destinations/sfmc/transform.js (5 hunks)
- src/v0/destinations/sfmc/transform.test.js (1 hunks)
Additional comments: 2
src/v0/destinations/sfmc/transform.js (1)
- 287-287: The addition of
responseBuilderSimple
to the module exports is consistent with the changes made in the file and the summary provided.src/v0/destinations/sfmc/transform.test.js (1)
- 1-178: The test suite for
responseBuilderSimple
is well-structured and covers a variety of scenarios including error handling and payload validation. The use of MockAxiosAdapter for simulating token retrieval is appropriate and the assertions within each test case are relevant to the expected outcomes. Good job on ensuring that the tests are comprehensive and that they validate both the success and error paths.
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (2)
- src/v0/destinations/sfmc/transform.js (5 hunks)
- src/v0/destinations/sfmc/transform.test.js (1 hunks)
Additional comments: 7
src/v0/destinations/sfmc/transform.js (6)
3-8: The changes to the imports are consistent with the summary and the removal of
isEmpty
from the imports is reflected in the code.225-226: The error message "Creating or updating contacts is disabled" has been updated and is now more specific, addressing the previous comment.
229-230: The error message "Event name is required for this track events" has been updated and is now more specific, addressing the previous comment.
232-237: The checks for
message.event
have been added as per the summary, ensuring that the event name is not empty, is a string, and is present inhashMapExternalKey
.251-252: The error message "Event type not supported" now includes the unsupported event type, addressing the previous comment.
288-288: The
responseBuilderSimple
function is now explicitly exported, which is consistent with the summary.src/v0/destinations/sfmc/transform.test.js (1)
- 1-125: The test suite for
responseBuilderSimple
function is comprehensive and covers various scenarios including identify calls, error handling for missing event names, unsupported event types, and mapped track calls. The setup of a mock Axios adapter is also correctly implemented for testing HTTP requests. The tests appear to be well-structured and should validate the functionality effectively.
Kudos, SonarCloud Quality Gate passed! |
Description of the change
> incident
For the above incident we are getting Generic Transformation error as the nature of the error is unhandled exception
The customer is wrongly instrumenting an invalid track event which does not containing
event
property for which we are missing validation. This PR Addresses the above issue with adding more validations for the SFMC destination for which the issue occursResolves INT-1085
Type of change
Related issues
Checklists
Development
Code review
Summary by CodeRabbit
New Features
Bug Fixes
Tests
responseBuilderSimple
function to validate functionality and error handling.