-
Notifications
You must be signed in to change notification settings - Fork 113
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: anonymousId overwriting userId at MoEngage destination #3914
base: develop
Are you sure you want to change the base?
Conversation
Thank you @jmlandi for contributing this PR. |
@jmlandi without this change, did you see any issue in the event you receive at the destination. The reason I am asking for this is because engineering team tested the current MoEngage destination (without this PR change) and it worked as expected. This is what I learned from the engineering team
Expanding more on why the current code works. This is how the response object looks like (which is an instruction for RudderStack data plane internal service to make the appropriate request to the destination). {
"version": "1",
"type": "REST",
"method": "POST",
"endpoint": "https://api-01.moengage.com/v1/customer/1231",
"headers": {
"Content-Type": "application/json",
"MOE-APPKEY": "1231",
"Authorization": "Basic Auth"
},
"params": {},
"body": {
"JSON": {
"customer_id": "random_anonId", // ---------> This gets sent to MoEngage and already set correctly i.e. userId || anon_Id
"type": "customer",
"attributes": {
"first_name": "patti",
"last_name": "jackson",
"email": "[email protected]",
"approved_reservation_count": 0,
"is_host": "false",
"is_renter": "true",
"phone": "18172292269",
"phone_verified": "true",
"reservation_count": 1,
"cu_date_time": "2024-11-12T16:30:53.728Z",
"ucid": "2024-11-12T16:30:53.728Z",
"cu_date": "2024-11-12T16:30:53.728Z"
}
},
"JSON_ARRAY": {},
"XML": {},
"FORM": {}
},
"files": {},
"userId": "random_anonId" // --------------> This data is irrelevant to MoEngage (the PR changes this property)
} The Let me know if you have any question or suggestion to further improve this code |
@gitcommitshow, thank you for your response. I understand that the That said, the userId in the message seems to be overwritten, which I believe is not the expected behavior—even if it doesn't fully solve my issue. Could you confirm if this is correct? Here is evidence from a recent event. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #3914 +/- ##
===========================================
- Coverage 90.48% 90.25% -0.24%
===========================================
Files 615 620 +5
Lines 32359 32518 +159
Branches 7687 7712 +25
===========================================
+ Hits 29281 29350 +69
- Misses 2822 2903 +81
- Partials 256 265 +9 ☔ View full report in Codecov by Sentry. |
Thanks for sharing the details @jmlandi.
Yes, that is correct. So we will go ahead with this PR as a fix for this different issue And we will separately investigate that "users being registered with the anonymousId" issue, I believe you're already in touch with your TAM and they have taken up that issue. You may continue discussion with them. |
@jmlandi you may delete the attached image in your comment now |
What are the changes introduced in this PR?
Changed the preference for
userId
overanonymousId
for MoEngage destination.What is the related Linear task?
No related Linear task for this change.
Please explain the objectives of your changes below
Any changes to existing capabilities/behavior? Mention the reason & what changes were made.
This change adjusts MoEngage destination behavior to prefer
userId
overanonymousId
when both are provided.Currently, when both
userId
andanonymousId
are present, the anonymous ID overwrites the user ID, leading to unexpected behavior, such as users receiving ananonymousId
from a web session that overrides the main user identification.For more details, see the opened issue #3892.
Any new dependencies introduced with this change?
No.
Any new generic utility introduced or modified? Please explain the changes.
No.
Any technical or performance-related considerations with this change?
No.
@coderabbitai review
Developer checklist
Reviewer checklist