-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: return 298 for filtered/dropped events in user transformer
- Loading branch information
1 parent
e7dbd2c
commit 367851c
Showing
5 changed files
with
363 additions
and
28 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
185 changes: 185 additions & 0 deletions
185
test/__tests__/data/user_transformation_service_filter_input.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,185 @@ | ||
[ | ||
{ | ||
"message": { | ||
"channel": "web", | ||
"context": { | ||
"app": { | ||
"build": "1.0.0", | ||
"name": "RudderLabs JavaScript SDK", | ||
"namespace": "com.rudderlabs.javascript", | ||
"version": "1.0.0" | ||
}, | ||
"traits": { | ||
"anonymousId": "123456" | ||
}, | ||
"library": { | ||
"name": "RudderLabs JavaScript SDK", | ||
"version": "1.0.0" | ||
}, | ||
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", | ||
"locale": "en-US", | ||
"ip": "0.0.0.0", | ||
"os": { | ||
"name": "", | ||
"version": "" | ||
}, | ||
"screen": { | ||
"density": 2 | ||
} | ||
}, | ||
"type": "identify", | ||
"messageId": "84e26acc-56a5-4835-8233-591137fca468", | ||
"originalTimestamp": "2019-10-14T09:03:17.562Z", | ||
"anonymousId": "123456", | ||
"userId": "123456", | ||
"integrations": { | ||
"All": true | ||
}, | ||
"sentAt": "2019-10-14T09:03:22.563Z" | ||
}, | ||
"metadata": { | ||
"messageId": "84e26acc-56a5-4835-8233-591137fca468", | ||
"sourceId": "s1", | ||
"destinationId": "d1" | ||
}, | ||
"destination": { | ||
"ID": 2, | ||
"Config": { | ||
"trackingID": "abcd" | ||
}, | ||
"Enabled": true, | ||
"Transformations": [ | ||
{ | ||
"VersionID": "24" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"message": { | ||
"channel": "web", | ||
"context": { | ||
"app": { | ||
"build": "1.0.0", | ||
"name": "RudderLabs JavaScript SDK", | ||
"namespace": "com.rudderlabs.javascript", | ||
"version": "1.0.0" | ||
}, | ||
"traits": { | ||
"email": "[email protected]", | ||
"anonymousId": "12345" | ||
}, | ||
"library": { | ||
"name": "RudderLabs JavaScript SDK", | ||
"version": "1.0.0" | ||
}, | ||
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", | ||
"locale": "en-US", | ||
"ip": "0.0.0.0", | ||
"os": { | ||
"name": "", | ||
"version": "" | ||
}, | ||
"screen": { | ||
"density": 2 | ||
} | ||
}, | ||
"type": "page", | ||
"messageId": "5e10d13a-bf9a-44bf-b884-43a9e591ea71", | ||
"originalTimestamp": "2019-10-14T11:15:18.299Z", | ||
"anonymousId": "00000000000000000000000000", | ||
"userId": "12345", | ||
"properties": { | ||
"path": "/abc", | ||
"referrer": "", | ||
"search": "", | ||
"title": "", | ||
"url": "" | ||
}, | ||
"integrations": { | ||
"All": true | ||
}, | ||
"name": "ApplicationLoaded", | ||
"sentAt": "2019-10-14T11:15:53.296Z" | ||
}, | ||
"metadata": { | ||
"messageId": "5e10d13a-bf9a-44bf-b884-43a9e591ea71", | ||
"sourceId": "s1", | ||
"destinationId": "d1" | ||
}, | ||
"destination": { | ||
"ID": 2, | ||
"Config": { | ||
"trackingID": "abcd" | ||
}, | ||
"Enabled": true, | ||
"Transformations": [ | ||
{ | ||
"VersionID": "24" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"message": { | ||
"channel": "web", | ||
"context": { | ||
"app": { | ||
"build": "1.0.0", | ||
"name": "RudderLabs JavaScript SDK", | ||
"namespace": "com.rudderlabs.javascript", | ||
"version": "1.0.0" | ||
}, | ||
"traits": { | ||
"email": "[email protected]", | ||
"anonymousId": "12345" | ||
}, | ||
"library": { | ||
"name": "RudderLabs JavaScript SDK", | ||
"version": "1.0.0" | ||
}, | ||
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", | ||
"locale": "en-US", | ||
"ip": "0.0.0.0", | ||
"os": { | ||
"name": "", | ||
"version": "" | ||
}, | ||
"screen": { | ||
"density": 2 | ||
} | ||
}, | ||
"type": "track", | ||
"messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", | ||
"originalTimestamp": "2019-10-14T11:15:18.300Z", | ||
"anonymousId": "00000000000000000000000000", | ||
"userId": "12345", | ||
"event": "test track event GA3", | ||
"properties": { | ||
"user_actual_role": "system_admin, system_user", | ||
"user_actual_id": 12345 | ||
}, | ||
"integrations": { | ||
"All": true | ||
}, | ||
"sentAt": "2019-10-14T11:15:53.296Z" | ||
}, | ||
"metadata": { | ||
"messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", | ||
"sourceId": "s1", | ||
"destinationId": "d1" | ||
}, | ||
"destination": { | ||
"ID": 2, | ||
"Config": { | ||
"trackingID": "abcd" | ||
}, | ||
"Enabled": true, | ||
"Transformations": [ | ||
{ | ||
"VersionID": "24" | ||
} | ||
] | ||
} | ||
} | ||
] |
74 changes: 74 additions & 0 deletions
74
test/__tests__/data/user_transformation_service_filter_output.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
{ | ||
"transformedEvents": [ | ||
{ | ||
"statusCode": 298, | ||
"metadata": { | ||
"sourceId": "s1", | ||
"destinationId": "d1", | ||
"messageIds": null, | ||
"messageId": "84e26acc-56a5-4835-8233-591137fca468" | ||
} | ||
}, | ||
{ | ||
"statusCode": 298, | ||
"metadata": { | ||
"sourceId": "s1", | ||
"destinationId": "d1", | ||
"messageIds": null, | ||
"messageId": "5e10d13a-bf9a-44bf-b884-43a9e591ea71" | ||
} | ||
}, | ||
{ | ||
"output": { | ||
"channel": "web", | ||
"context": { | ||
"app": { | ||
"build": "1.0.0", | ||
"name": "RudderLabs JavaScript SDK", | ||
"namespace": "com.rudderlabs.javascript", | ||
"version": "1.0.0" | ||
}, | ||
"traits": { | ||
"email": "[email protected]", | ||
"anonymousId": "12345" | ||
}, | ||
"library": { | ||
"name": "RudderLabs JavaScript SDK", | ||
"version": "1.0.0" | ||
}, | ||
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", | ||
"locale": "en-US", | ||
"ip": "0.0.0.0", | ||
"os": { | ||
"name": "", | ||
"version": "" | ||
}, | ||
"screen": { | ||
"density": 2 | ||
} | ||
}, | ||
"type": "track", | ||
"messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", | ||
"originalTimestamp": "2019-10-14T11:15:18.300Z", | ||
"anonymousId": "00000000000000000000000000", | ||
"userId": "12345", | ||
"event": "test track event GA3", | ||
"properties": { | ||
"user_actual_role": "system_admin, system_user", | ||
"user_actual_id": 12345 | ||
}, | ||
"integrations": { | ||
"All": true | ||
}, | ||
"sentAt": "2019-10-14T11:15:53.296Z" | ||
}, | ||
"metadata": { | ||
"messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be", | ||
"sourceId": "s1", | ||
"destinationId": "d1" | ||
}, | ||
"statusCode": 200 | ||
} | ||
], | ||
"retryStatus": 200 | ||
} |
Oops, something went wrong.