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

chore(release): pull hotfix-release/v1.44.1 into main #2689

Merged
merged 2 commits into from
Oct 6, 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
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
35 changes: 35 additions & 0 deletions test/__tests__/data/criteo_audience_proxy_input.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,41 @@
"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 Down
32 changes: 30 additions & 2 deletions test/__tests__/data/criteo_audience_proxy_output.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[
{
{
"output": {
"status": 200,
"message": "Request Processed Successfully",
Expand All @@ -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 Expand Up @@ -48,7 +76,7 @@
"traceIdentifier": "80a1a0ba3981b04da847d05700752c77",
"type": "authorization"
}
]
]
},
"status": 404
},
Expand Down