Skip to content

Commit 43abf9c

Browse files
ItsSudipjmlandi
andauthored
fix: user order (#3944)
* fix: anonymousId overwriting userId at MoEngage destination (#3914) fix/moengage-anonymousid-over-userid Co-authored-by: Sudip Paul <[email protected]> * chore: fix test cases --------- Co-authored-by: Landi <[email protected]>
1 parent 227419f commit 43abf9c

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

src/v0/destinations/moengage/transform.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function responseBuilderSimple(message, category, destination) {
4949
// using base64 and prepends it with the string 'Basic '.
5050
Authorization: `Basic ${btoa(`${apiId}:${apiKey}`)}`,
5151
};
52-
response.userId = message.anonymousId || message.userId;
52+
response.userId = message.userId || message.anonymousId;
5353
if (payload) {
5454
switch (category.type) {
5555
case 'identify':

test/integrations/destinations/moengage/processor/data.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ export const data = [
292292
FORM: {},
293293
},
294294
files: {},
295-
userId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5',
295+
userId: 'rudder123',
296296
},
297297
statusCode: 200,
298298
},
@@ -418,7 +418,7 @@ export const data = [
418418
files: {},
419419
method: 'POST',
420420
params: {},
421-
userId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5',
421+
userId: 'rudder123',
422422
headers: {
423423
'MOE-APPKEY': 'W0ZHNMPI2O4KHJ48ZILZACRA',
424424
'Content-Type': 'application/json',
@@ -686,7 +686,7 @@ export const data = [
686686
files: {},
687687
method: 'POST',
688688
params: {},
689-
userId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5',
689+
userId: 'rudder123',
690690
headers: {
691691
'MOE-APPKEY': 'W0ZHNMPI2O4KHJ48ZILZACRA',
692692
'Content-Type': 'application/json',
@@ -719,7 +719,7 @@ export const data = [
719719
files: {},
720720
method: 'POST',
721721
params: {},
722-
userId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5',
722+
userId: 'rudder123',
723723
headers: {
724724
'MOE-APPKEY': 'W0ZHNMPI2O4KHJ48ZILZACRA',
725725
'Content-Type': 'application/json',
@@ -851,7 +851,7 @@ export const data = [
851851
files: {},
852852
method: 'POST',
853853
params: {},
854-
userId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5',
854+
userId: 'rudder123',
855855
headers: {
856856
'MOE-APPKEY': 'W0ZHNMPI2O4KHJ48ZILZACRA',
857857
'Content-Type': 'application/json',
@@ -983,7 +983,7 @@ export const data = [
983983
files: {},
984984
method: 'POST',
985985
params: {},
986-
userId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5',
986+
userId: 'rudder123',
987987
headers: {
988988
'MOE-APPKEY': 'W0ZHNMPI2O4KHJ48ZILZACRA',
989989
'Content-Type': 'application/json',
@@ -1875,7 +1875,7 @@ export const data = [
18751875
FORM: {},
18761876
},
18771877
files: {},
1878-
userId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5',
1878+
userId: 'rudder123',
18791879
},
18801880
statusCode: 200,
18811881
},
@@ -2008,7 +2008,7 @@ export const data = [
20082008
files: {},
20092009
method: 'POST',
20102010
params: {},
2011-
userId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5',
2011+
userId: 'rudder123',
20122012
headers: {
20132013
'MOE-APPKEY': 'W0ZHNMPI2O4KHJ48ZILZACRA',
20142014
'Content-Type': 'application/json',
@@ -2041,7 +2041,7 @@ export const data = [
20412041
files: {},
20422042
method: 'POST',
20432043
params: {},
2044-
userId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5',
2044+
userId: 'rudder123',
20452045
headers: {
20462046
'MOE-APPKEY': 'W0ZHNMPI2O4KHJ48ZILZACRA',
20472047
'Content-Type': 'application/json',
@@ -2318,7 +2318,7 @@ export const data = [
23182318
FORM: {},
23192319
},
23202320
files: {},
2321-
userId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5',
2321+
userId: 'rudder123',
23222322
},
23232323
statusCode: 200,
23242324
},
@@ -2599,7 +2599,7 @@ export const data = [
25992599
FORM: {},
26002600
},
26012601
files: {},
2602-
userId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5',
2602+
userId: 'rudder123',
26032603
},
26042604
statusCode: 200,
26052605
},
@@ -2875,7 +2875,7 @@ export const data = [
28752875
method: 'POST',
28762876
params: {},
28772877
type: 'REST',
2878-
userId: 'anon-dummyId-1',
2878+
userId: 'userId16',
28792879
version: '1',
28802880
},
28812881
statusCode: 200,

test/integrations/destinations/moengage/router/data.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ export const data = [
324324
FORM: {},
325325
},
326326
files: {},
327-
userId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5',
327+
userId: 'rudder123',
328328
},
329329
metadata: [{ jobId: 1, userId: 'u1' }],
330330
batched: false,
@@ -393,7 +393,7 @@ export const data = [
393393
FORM: {},
394394
},
395395
files: {},
396-
userId: '4eb021e9-a2af-4926-ae82-fe996d12f3c5',
396+
userId: 'rudder123',
397397
},
398398
metadata: [{ jobId: 2, userId: 'u1' }],
399399
batched: false,

0 commit comments

Comments
 (0)