From 55629d6d871d275de601a11ec223e0c283641d7b Mon Sep 17 00:00:00 2001 From: Debanjan Date: Thu, 14 Sep 2023 18:02:05 +0530 Subject: [PATCH 1/2] fix(redis): add destination_id in the key while preparing the event for profiles<>redis store --- src/v0/destinations/redis/transform.js | 7 ++++--- test/__tests__/data/redis_output.json | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/v0/destinations/redis/transform.js b/src/v0/destinations/redis/transform.js index f57cadb7e6..124569c8e8 100644 --- a/src/v0/destinations/redis/transform.js +++ b/src/v0/destinations/redis/transform.js @@ -31,9 +31,9 @@ const isSubEventTypeProfiles = (message) => { return sources.profiles_entity && sources.profiles_id_type && sources.profiles_model; }; -const transforrmSubEventTypeProfiles = (message, workspaceId) => { +const transformSubEventTypeProfiles = (message, workspaceId, destinationId) => { // form the hash - const hash = `${workspaceId}:${message.context.sources.profiles_entity}:${message.context.sources.profiles_id_type}:${message.userId}`; + const hash = `${workspaceId}:${destinationId}:${message.context.sources.profiles_entity}:${message.context.sources.profiles_id_type}:${message.userId}`; const key = `${message.context.sources.profiles_model}`; const value = JSON.stringify(message.traits); return { @@ -59,11 +59,12 @@ const process = (event) => { } const { prefix } = destination.Config; + const destinationId = destination.ID; const keyPrefix = isEmpty(prefix) ? '' : `${prefix.trim()}:`; if (isSubEventTypeProfiles(message)) { const { workspaceId } = metadata; - return transforrmSubEventTypeProfiles(message, workspaceId); + return transformSubEventTypeProfiles(message, workspaceId, destinationId); } const hmap = { diff --git a/test/__tests__/data/redis_output.json b/test/__tests__/data/redis_output.json index 57d8387041..69d2aa20c2 100644 --- a/test/__tests__/data/redis_output.json +++ b/test/__tests__/data/redis_output.json @@ -81,7 +81,7 @@ }, { "message": { - "hash": "some-workspace-id:some-entity:some-id-type:some-user-id", + "hash": "some-workspace-id:1WhcOCGgj9asZu850HvugU2C3Aq:some-entity:some-id-type:some-user-id", "key": "some-model", "value": "{\"MODEL_ID\":\"1691755780\",\"VALID_AT\":\"2023-08-11T11:32:44.963062Z\",\"USER_MAIN_ID\":\"rid5530313526204a95efe71d98cd17d5a1\",\"CHURN_SCORE_7_DAYS\":0.027986,\"PERCENTILE_CHURN_SCORE_7_DAYS\":0}" }, From 80beb1ef4b55299b25ebc552b1d9adbcd64390f9 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 14 Sep 2023 14:32:24 +0000 Subject: [PATCH 2/2] chore(release): 1.41.1 --- CHANGELOG.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fdb53f4527..e66ba72716 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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.41.1](https://github.com/rudderlabs/rudder-transformer/compare/v1.41.0...v1.41.1) (2023-09-14) + + +### Bug Fixes + +* **redis:** add destination_id in the key ([55629d6](https://github.com/rudderlabs/rudder-transformer/commit/55629d6d871d275de601a11ec223e0c283641d7b)) + ## [1.41.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.40.2...v1.41.0) (2023-09-11) diff --git a/package-lock.json b/package-lock.json index 8e478ec704..5f1ad32287 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rudder-transformer", - "version": "1.41.0", + "version": "1.41.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rudder-transformer", - "version": "1.41.0", + "version": "1.41.1", "license": "ISC", "dependencies": { "@amplitude/ua-parser-js": "^0.7.24", diff --git a/package.json b/package.json index 2241007ee8..ad4c3a3848 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rudder-transformer", - "version": "1.41.0", + "version": "1.41.1", "description": "", "homepage": "https://github.com/rudderlabs/rudder-transformer#readme", "bugs": {