Skip to content

Commit

Permalink
chore(release): pull hotfix-release/v1.23.1 into main (#2083)
Browse files Browse the repository at this point in the history
  • Loading branch information
saikumarrs authored Apr 20, 2023
2 parents b95a2f9 + 7d9a047 commit a48de76
Show file tree
Hide file tree
Showing 5 changed files with 138 additions and 4 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

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.23.1](https://github.com/rudderlabs/rudder-transformer/compare/v1.23.0...v1.23.1) (2023-04-20)


### Bug Fixes

* anonymous id default value ([#2081](https://github.com/rudderlabs/rudder-transformer/issues/2081)) ([6457c09](https://github.com/rudderlabs/rudder-transformer/commit/6457c09a0f0963179388ba8535fbcd9f872ba9fd))
* Default Val for Anon Id ([4dd1df7](https://github.com/rudderlabs/rudder-transformer/commit/4dd1df7e25bd6fea7770e6c38c4c63bb1d81141c))

## [1.23.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.22.2...v1.23.0) (2023-04-17)


Expand Down
2 changes: 1 addition & 1 deletion 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.23.0",
"version": "1.23.1",
"description": "",
"homepage": "https://github.com/rudderlabs/rudder-transformer#readme",
"bugs": {
Expand Down
12 changes: 10 additions & 2 deletions src/v0/sources/shopify/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,26 +151,34 @@ const setAnonymousIdorUserIdFromDb = async (message, metricMetadata) => {
}
return;
}
cartToken = message.properties?.cart_token;
cartToken = message.properties.cart_token;
break;
/*
* we dont have cart_token for carts_create and update events but have id and token field
* which later on for orders become cart_token so we are fethcing cartToken from id
*/
case SHOPIFY_TRACK_MAP.carts_create:
case SHOPIFY_TRACK_MAP.carts_update:
cartToken = message.properties?.id;
cartToken = message.properties?.id || message.properties?.token;
break;
// https://help.shopify.com/en/manual/orders/edit-orders -> order can be edited through shopify-admin only
// https://help.shopify.com/en/manual/orders/fulfillment/setting-up-fulfillment -> fullfillments wont include cartToken neither in manual or automatiic
case SHOPIFY_TRACK_MAP.orders_edited:
case SHOPIFY_TRACK_MAP.orders_delete:
case SHOPIFY_TRACK_MAP.fulfillments_create:
case SHOPIFY_TRACK_MAP.fulfillments_update:
if (!message.userId) {
message.setProperty('userId', 'shopify-admin');
}
return;
default:
logger.error(`Event ${message.event} not supported`);
}
if(!isDefinedAndNotNull(cartToken)){
if (!message.userId) {
message.setProperty('userId', "shopify-admin");
}
return;
}
let anonymousIDfromDB;
const executeStartTime = Date.now();
Expand Down
118 changes: 118 additions & 0 deletions test/__tests__/data/redis/shopify_source.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,42 @@
[
{
"description": "Track Call -> carts_create with no cartToken",
"input": {
"query_parameters": {
"topic": [
"carts_create"
]
},
"line_items": [],
"note": null,
"updated_at": "2023-02-10T12:16:07.251Z",
"created_at": "2023-02-10T12:05:04.402Z"
},
"output": {
"userId": "shopify-admin",
"context": {
"library": {
"name": "RudderStack Shopify Cloud",
"version": "1.0.0"
},
"integration": {
"name": "SHOPIFY"
},
"topic": "carts_create"
},
"event": "Cart Create",
"integrations": {
"SHOPIFY": true
},
"type": "track",
"properties": {
"created_at": "2023-02-10T12:05:04.402Z",
"note": null,
"products": [],
"updated_at": "2023-02-10T12:16:07.251Z"
}
}
},
{
"description": "Track Call -> carts_create with invalid cartToken",
"input": {
Expand Down Expand Up @@ -41,6 +79,86 @@
}
}
},
{
"description": "Track Call -> orders_delete with invalid cartToken",
"input": {
"id": "shopify_test3",
"query_parameters": {
"topic": [
"orders_delete"
]
},
"line_items": [],
"note": null,
"updated_at": "2023-02-10T12:16:07.251Z",
"created_at": "2023-02-10T12:05:04.402Z"
},
"output": {
"context": {
"library": {
"name": "RudderStack Shopify Cloud",
"version": "1.0.0"
},
"integration": {
"name": "SHOPIFY"
},
"topic": "orders_delete"
},
"event": "Order Deleted",
"integrations": {
"SHOPIFY": true
},
"type": "track",
"userId":"shopify-admin",
"properties": {
"created_at": "2023-02-10T12:05:04.402Z",
"id": "shopify_test3",
"note": null,
"products": [],
"updated_at": "2023-02-10T12:16:07.251Z"
}
}
},
{
"description": "Track Call -> checkouts_delete with invalid cartToken",
"input": {
"id": "shopify_test3",
"query_parameters": {
"topic": [
"checkouts_delete"
]
},
"line_items": [],
"note": null,
"updated_at": "2023-02-10T12:16:07.251Z",
"created_at": "2023-02-10T12:05:04.402Z"
},
"output": {
"context": {
"library": {
"name": "RudderStack Shopify Cloud",
"version": "1.0.0"
},
"integration": {
"name": "SHOPIFY"
},
"topic": "checkouts_delete"
},
"event": "Checkout Deleted",
"integrations": {
"SHOPIFY": true
},
"type": "track",
"userId":"shopify-admin",
"properties": {
"created_at": "2023-02-10T12:05:04.402Z",
"id": "shopify_test3",
"note": null,
"products": [],
"updated_at": "2023-02-10T12:16:07.251Z"
}
}
},
{
"description": "Track Call -> carts_update",
"input": {
Expand Down

0 comments on commit a48de76

Please sign in to comment.