Skip to content

Commit

Permalink
fix(integration): Algolia in CDK v2 now errors out for non string eve…
Browse files Browse the repository at this point in the history
…nt names (#1867)
  • Loading branch information
shrouti1507 authored Feb 20, 2023
1 parent 7ff1b4a commit 5be8891
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 0 deletions.
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"
}
]

0 comments on commit 5be8891

Please sign in to comment.