Skip to content
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(integration): algolia in cdk v2 now errors out for non string event names #1867

Merged
merged 1 commit into from
Feb 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/cdk/v2/destinations/algolia/procWorkflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ steps:
$.assert(.message.type === {{$.EventType.TRACK}},
"message type " + .message.type + " not supported")
$.assert(.message.event, "event is required for track call")
$.assert(typeof .message.event === "string", "event name should be a string")

- name: preparePayload
template: |
Expand Down
68 changes: 68 additions & 0 deletions test/__tests__/data/algolia_input.json
Original file line number Diff line number Diff line change
Expand Up @@ -732,5 +732,73 @@
]
}
}
},
{
"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]",
"firstName": "test",
"lastName": "one"
},
"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
},
"page": {
"path": "/destinations/ometria",
"referrer": "",
"search": "",
"title": "",
"url": "https://docs.rudderstack.com/destinations/ometria",
"category": "destination",
"initial_referrer": "https://docs.rudderstack.com",
"initial_referring_domain": "docs.rudderstack.com"
}
},
"type": "track",
"messageId": "84e26acc-56a5-4835-8233-591137fca468",
"session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22",
"originalTimestamp": "2019-10-14T09:03:17.562Z",
"anonymousId": "123456",
"event": ["abc", "def"],
"userId": "testuserId1",
"properties": {
"filters": ["field1:hello", "val1:val2"]
},
"integrations": {
"All": true
},
"sentAt": "2019-10-14T09:03:22.563Z"
},
"destination": {
"Config": {
"apiKey": "34d8efa09c5b048bbacc6af157f2e687",
"applicationId": "O2YARRI15I",
"eventTypeSettings": [
{
"from": "product clicked",
"to": "cLick "
}
]
}
}
}
]
4 changes: 4 additions & 0 deletions test/__tests__/data/algolia_output.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,9 @@
{
"statusCode": "400",
"message": "Missing required value from \"properties.index\""
},
{
"statusCode": "400",
"message": "event name should be a string"
}
]