Skip to content

Commit

Permalink
fix: main -> develop conflict (#2692)
Browse files Browse the repository at this point in the history
  • Loading branch information
sanpj2292 authored Oct 6, 2023
2 parents 99f39f5 + 252e168 commit 75d665d
Show file tree
Hide file tree
Showing 7 changed files with 98 additions and 33 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [1.44.1](https://github.com/rudderlabs/rudder-transformer/compare/v1.44.0...v1.44.1) (2023-10-06)


### Bug Fixes

* criteo_aud auth_token expire code incorporated ([#2687](https://github.com/rudderlabs/rudder-transformer/issues/2687)) ([cbe333a](https://github.com/rudderlabs/rudder-transformer/commit/cbe333a9e4eea7088bfe46a2aaf09d489a7bc7c7))

## [1.44.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.43.1...v1.44.0) (2023-09-29)


Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rudder-transformer",
"version": "1.44.0",
"version": "1.44.1",
"description": "",
"homepage": "https://github.com/rudderlabs/rudder-transformer#readme",
"bugs": {
Expand Down
6 changes: 5 additions & 1 deletion src/v0/destinations/criteo_audience/networkHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ const criteoAudienceRespHandler = (destResponse, stageMsg) => {

// https://developers.criteo.com/marketing-solutions/docs/api-error-types#error-category-types
// to handle the case when authorization-token is invalid
if (status === 401 && matchErrorCode('authorization-token-invalid', response)) {
if (
status === 401 &&
(matchErrorCode('authorization-token-invalid', response) ||
matchErrorCode('authorization-token-expired', response))
) {
throw new NetworkError(
`${response?.errors[0]?.title} ${stageMsg}`,
status,
Expand Down
17 changes: 17 additions & 0 deletions test/__mocks__/data/criteo_audience/proxy_response.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@
"https://api.criteo.com/2022-10/audiences/34894/contactlist": {
"status": 200
},
"https://api.criteo.com/2022-10/audiences/3485/contactlist": {
"code": "400",
"response": {
"data": {
"errors": [
{
"traceIdentifier": "80a1a0ba3981b04da847d05700752c77",
"type": "authorization",
"code": "authorization-token-expired",
"instance": "/2022-10/audiences/123/contactlist",
"title": "The authorization token has expired"
}
]
},
"status": 401
}
},
"https://api.criteo.com/2022-10/audiences/34895/contactlist": {
"code": "400",
"response": {
Expand Down
67 changes: 38 additions & 29 deletions test/__tests__/data/criteo_audience_proxy_input.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@
"attributes": {
"operation": "remove",
"identifierType": "gum",
"identifiers": [
"sample_gum3"
],
"identifiers": ["sample_gum3"],
"internalIdentifiers": false,
"gumCallerId": "329739"
}
Expand All @@ -33,6 +31,37 @@
"destination": "criteo_audience"
}
},
{
"version": "1",
"type": "REST",
"method": "PATCH",
"endpoint": "https://api.criteo.com/2022-10/audiences/3485/contactlist",
"headers": {
"Authorization": "Bearer success_access_token",
"Content-Type": "application/json",
"Accept": "application/json"
},
"body": {
"JSON": {
"data": {
"type": "ContactlistAmendment",
"attributes": {
"operation": "add",
"identifierType": "madid",
"identifiers": ["sample_madid", "sample_madid_1", "sample_madid_2"],
"internalIdentifiers": false
}
}
},
"JSON_ARRAY": {},
"XML": {},
"FORM": {}
},
"files": {},
"params": {
"destination": "criteo_audience"
}
},
{
"version": "1",
"type": "REST",
Expand All @@ -50,11 +79,7 @@
"attributes": {
"operation": "add",
"identifierType": "madid",
"identifiers": [
"sample_madid",
"sample_madid_1",
"sample_madid_2"
],
"identifiers": ["sample_madid", "sample_madid_1", "sample_madid_2"],
"internalIdentifiers": false
}
}
Expand Down Expand Up @@ -85,11 +110,7 @@
"attributes": {
"operation": "add",
"identifierType": "madid",
"identifiers": [
"sample_madid",
"sample_madid_1",
"sample_madid_2"
],
"identifiers": ["sample_madid", "sample_madid_1", "sample_madid_2"],
"internalIdentifiers": false
}
}
Expand Down Expand Up @@ -120,11 +141,7 @@
"attributes": {
"operation": "add",
"identifierType": "madid",
"identifiers": [
"sample_madid",
"sample_madid_1",
"sample_madid_2"
],
"identifiers": ["sample_madid", "sample_madid_1", "sample_madid_2"],
"internalIdentifiers": false
}
}
Expand Down Expand Up @@ -155,11 +172,7 @@
"attributes": {
"operation": "add",
"identifierType": "madid",
"identifiers": [
"sample_madid",
"sample_madid_1",
"sample_madid_2"
],
"identifiers": ["sample_madid", "sample_madid_1", "sample_madid_2"],
"internalIdentifiers": false
}
}
Expand Down Expand Up @@ -190,11 +203,7 @@
"attributes": {
"operation": "add",
"identifierType": "madid",
"identifiers": [
"sample_madid",
"sample_madid_1",
"sample_madid_2"
],
"identifiers": ["sample_madid", "sample_madid_1", "sample_madid_2"],
"internalIdentifiers": false
}
}
Expand All @@ -208,4 +217,4 @@
"destination": "criteo_audience"
}
}
]
]
28 changes: 28 additions & 0 deletions test/__tests__/data/criteo_audience_proxy_output.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,34 @@
}
}
},
{
"output": {
"status": 401,
"authErrorCategory": "REFRESH_TOKEN",
"destinationResponse": {
"errors": [
{
"traceIdentifier": "80a1a0ba3981b04da847d05700752c77",
"type": "authorization",
"code": "authorization-token-expired",
"instance": "/2022-10/audiences/123/contactlist",
"title": "The authorization token has expired"
}
]
},
"message": "The authorization token has expired during criteo_audience response transformation",
"statTags": {
"destType": "CRITEO_AUDIENCE",
"errorCategory": "network",
"destinationId": "Non-determininable",
"workspaceId": "Non-determininable",
"errorType": "aborted",
"feature": "dataDelivery",
"implementation": "native",
"module": "destination"
}
}
},
{
"output": {
"status": 401,
Expand Down

0 comments on commit 75d665d

Please sign in to comment.