From ba2accd14a9d99f2c55a9eab34f65e6e4d989e4a Mon Sep 17 00:00:00 2001 From: Manish Kumar <144022547+manish339k@users.noreply.github.com> Date: Wed, 22 Jan 2025 14:10:39 +0530 Subject: [PATCH 1/2] fix: revert feat added drop traits in track call feature for mixpanel (#4003) * fix: revert feat added drop traits in track call feature for mixpanel * fix: fix device type is undefined --- src/v0/destinations/mp/transform.js | 5 +- src/v0/destinations/mp/util.js | 2 +- .../destinations/mp/processor/data.ts | 111 ------------------ 3 files changed, 2 insertions(+), 116 deletions(-) diff --git a/src/v0/destinations/mp/transform.js b/src/v0/destinations/mp/transform.js index 1967e110c92..02eca8ed22f 100644 --- a/src/v0/destinations/mp/transform.js +++ b/src/v0/destinations/mp/transform.js @@ -163,12 +163,9 @@ const getEventValueForTrackEvent = (message, destination) => { } const unixTimestamp = toUnixTimestampInMS(message.timestamp || message.originalTimestamp); - - const traits = destination.Config?.dropTraitsInTrackEvent ? {} : { ...message.context.traits }; - let properties = { ...message.properties, - ...traits, + ...get(message, 'context.traits'), ...mappedProperties, token: destination.Config.token, distinct_id: message.userId || message.anonymousId, diff --git a/src/v0/destinations/mp/util.js b/src/v0/destinations/mp/util.js index a62dca0f4e7..50a8f9ac2b8 100644 --- a/src/v0/destinations/mp/util.js +++ b/src/v0/destinations/mp/util.js @@ -48,7 +48,7 @@ const populateDeviceFieldsInPayload = (message, rawPayload) => { if (isAppleFamily(device.type)) { payload = constructPayload(message, mPProfileIosConfigJson); updatedRawPayload.$ios_devices = deviceTokenArray; - } else if (device.type.toLowerCase() === 'android') { + } else if (device.type?.toLowerCase() === 'android') { payload = constructPayload(message, mPProfileAndroidConfigJson); updatedRawPayload.$android_devices = deviceTokenArray; } diff --git a/test/integrations/destinations/mp/processor/data.ts b/test/integrations/destinations/mp/processor/data.ts index c35d2013c6a..d13cf64cae2 100644 --- a/test/integrations/destinations/mp/processor/data.ts +++ b/test/integrations/destinations/mp/processor/data.ts @@ -6190,115 +6190,4 @@ export const data = [ }, }, }, - { - name: 'mp', - description: 'Track event test when dropTraitsInTrackEvent is true', - feature: 'processor', - module: 'destination', - version: 'v0', - input: { - request: { - body: [ - { - destination: overrideDestination(sampleDestination, { - dropTraitsInTrackEvent: true, - }), - message: { - type: 'track', - event: 'FirstTrackCall12', - sentAt: '2021-09-30T07:15:23.523Z', - channel: 'web', - context: { - os: { name: '', version: '' }, - app: { - name: 'RudderLabs JavaScript SDK', - build: '1.0.0', - version: '1.1.18', - namespace: 'com.rudderlabs.javascript', - }, - page: { - url: 'http://127.0.0.1:7307/Testing/App_for_testingTool/', - path: '/Testing/App_for_testingTool/', - title: 'Document', - search: '', - tab_url: 'http://127.0.0.1:7307/Testing/App_for_testingTool/', - referrer: 'http://127.0.0.1:7307/Testing/', - initial_referrer: 'http://127.0.0.1:7307/Testing/', - referring_domain: '127.0.0.1:7307', - initial_referring_domain: '127.0.0.1:7307', - }, - locale: 'en-US', - screen: { width: 1440, height: 900, density: 2, innerWidth: 590, innerHeight: 665 }, - traits: { - anonymousId: 'ea776ad0-3136-44fb-9216-5b1578609a2b', - userId: 'as09sufa09usaf09as0f9uasf', - id: 'as09sufa09usaf09as0f9uasf', - firstName: 'Bob', - lastName: 'Marley', - name: 'Bob Marley', - age: 43, - email: 'bob@marleymail.com', - phone: '+447748544123', - birthday: '1987-01-01T20:08:59+0000', - createdAt: '2022-01-21T14:10:12+0000', - address: '51,B.L.T road, Kolkata-700060', - description: 'I am great', - gender: 'male', - title: 'Founder', - username: 'bobm', - website: 'https://bobm.com', - randomProperty: 'randomValue', - }, - library: { name: 'RudderLabs JavaScript SDK', version: '1.1.18' }, - campaign: {}, - userAgent: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.82 Safari/537.36', - }, - rudderId: '294702c7-8732-4fb3-b39f-f3bdffe1aa88', - messageId: '0d5c1a4a-27e4-41da-a246-4d01f44e74bd', - userId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', - properties: { foo: 'bar', $deviceId: 'nkasdnkasd' }, - anonymousId: '1dbb5784-b8e2-4074-8644-9920145b7ae5', - integrations: { All: true }, - originalTimestamp: '2021-09-30T07:15:23.523Z', - }, - }, - ], - method: 'POST', - }, - pathSuffix: '', - }, - output: { - response: { - status: 200, - body: [ - { - output: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: 'https://api.mixpanel.com/import/', - headers: { - Authorization: 'Basic dGVzdF9hcGlfdG9rZW46', - 'Content-Type': 'application/json', - }, - params: { strict: 0 }, - body: { - JSON: {}, - JSON_ARRAY: { - batch: - '[{"event":"FirstTrackCall12","properties":{"foo":"bar","$deviceId":"nkasdnkasd","$user_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","$current_url":"http://127.0.0.1:7307/Testing/App_for_testingTool/","$referrer":"http://127.0.0.1:7307/Testing/","$screen_height":900,"$screen_width":1440,"$screen_dpi":2,"mp_lib":"RudderLabs JavaScript SDK","$app_build_number":"1.0.0","$app_version_string":"1.1.18","$insert_id":"0d5c1a4a-27e4-41da-a246-4d01f44e74bd","token":"test_api_token","distinct_id":"e6ab2c5e-2cda-44a9-a962-e2f67df78bca","time":1632986123523,"$browser":"Chrome","$browser_version":"93.0.4577.82"}}]', - }, - XML: {}, - FORM: {}, - }, - files: {}, - userId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca', - }, - statusCode: 200, - }, - ], - }, - }, - }, ]; From a7ee3cb09a4903214a12cb18b6cb769286e2509c Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Wed, 22 Jan 2025 08:44:01 +0000 Subject: [PATCH 2/2] chore(release): 1.88.2 --- 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 36831e82049..52e5a452c8e 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.88.2](https://github.com/rudderlabs/rudder-transformer/compare/v1.88.1...v1.88.2) (2025-01-22) + + +### Bug Fixes + +* revert feat added drop traits in track call feature for mixpanel ([#4003](https://github.com/rudderlabs/rudder-transformer/issues/4003)) ([ba2accd](https://github.com/rudderlabs/rudder-transformer/commit/ba2accd14a9d99f2c55a9eab34f65e6e4d989e4a)) + ### [1.88.1](https://github.com/rudderlabs/rudder-transformer/compare/v1.88.0...v1.88.1) (2025-01-21) ## [1.88.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.87.1...v1.88.0) (2025-01-20) diff --git a/package-lock.json b/package-lock.json index ab29d6987a6..63074987e06 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rudder-transformer", - "version": "1.88.1", + "version": "1.88.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rudder-transformer", - "version": "1.88.1", + "version": "1.88.2", "license": "ISC", "dependencies": { "@amplitude/ua-parser-js": "0.7.24", diff --git a/package.json b/package.json index 8acef6b6af3..0d16d5feae6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rudder-transformer", - "version": "1.88.1", + "version": "1.88.2", "description": "", "homepage": "https://github.com/rudderlabs/rudder-transformer#readme", "bugs": {