Skip to content

Commit

Permalink
fix: resolve develop main conflict (#2327)
Browse files Browse the repository at this point in the history
  • Loading branch information
sanpj2292 authored Jul 3, 2023
2 parents 2a762c0 + d49c0d1 commit 1aea7cd
Show file tree
Hide file tree
Showing 12 changed files with 427 additions and 11 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

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.34.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.33.0...v1.34.0) (2023-06-30)


### Features

* **iterable:** update addition of default value for some fields ([#2319](https://github.com/rudderlabs/rudder-transformer/issues/2319)) ([0dfb7b6](https://github.com/rudderlabs/rudder-transformer/commit/0dfb7b68388b3169a2cf054614e83c7411324157))


### Bug Fixes

* mixpanel group call ([#2318](https://github.com/rudderlabs/rudder-transformer/issues/2318)) ([2f78436](https://github.com/rudderlabs/rudder-transformer/commit/2f78436a7633a84020c66b53eca3770186458683))

## [1.33.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.32.3...v1.33.0) (2023-06-23)


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.33.0",
"version": "1.34.0",
"description": "",
"homepage": "https://github.com/rudderlabs/rudder-transformer#readme",
"bugs": {
Expand Down
4 changes: 4 additions & 0 deletions src/v0/destinations/mp/transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,10 @@ const processGroupEvents = (message, type, destination) => {
} else {
throw new ConfigurationError('Group Key Settings is not configured');
}

if (returnValue.length === 0) {
throw new InstrumentationError('Group Key is not present. Aborting message');
}
return returnValue;
};

Expand Down
10 changes: 8 additions & 2 deletions src/v0/util/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,13 @@ const flattenMap = (collection) => _.flatMap(collection, (x) => x);
// GENERIC UTLITY
// ========================================================================

const getEventTime = (message) => new Date(message.timestamp).toISOString();
const getEventTime = (message) => {
try {
return new Date(message.timestamp).toISOString();
} catch (err) {
return new Date(message.originalTimestamp).toISOString();
}
};

const base64Convertor = (string) => Buffer.from(string).toString('base64');

Expand Down Expand Up @@ -1375,7 +1381,7 @@ const getErrorStatusCode = (error, defaultStatusCode = HTTP_STATUS_CODES.INTERNA
/**
* Used for generating error response with stats from native and built errors
*/
function generateErrorObject(error, defTags = {}, shouldEnrichErrorMessage = true) {
function generateErrorObject(error, defTags = {}, shouldEnrichErrorMessage = false) {
let errObject = error;
let errorMessage = error.message;
if (shouldEnrichErrorMessage) {
Expand Down
3 changes: 2 additions & 1 deletion test/__tests__/data/iterable_input.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
"city": "Bangalore",
"name": "manashi",
"email": "[email protected]",
"country": "India"
"country": "India",
"preferUserId": false
},
"context": {
"traits": {
Expand Down
4 changes: 2 additions & 2 deletions test/__tests__/data/marketo_router_output.json
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@
{
"batched": false,
"statusCode": 400,
"error": "{\"message\":\"Request Failed for marketo, Lookup field 'userId' not found (Aborted).[Marketo Transformer]: During lead look up using email\",\"destinationResponse\":{\"response\":{\"requestId\":\"142e4#1835b117b76\",\"success\":false,\"errors\":[{\"code\":\"1006\",\"message\":\"Lookup field 'userId' not found\"}]},\"status\":200}}",
"error": "Request Failed for marketo, Lookup field 'userId' not found (Aborted).[Marketo Transformer]: During lead look up using email",
"statTags": {
"errorCategory": "network",
"errorType": "aborted"
Expand Down Expand Up @@ -479,7 +479,7 @@
{
"batched": false,
"statusCode": 400,
"error": "{\"message\":\"Error occurred [Marketo Transformer]: During lead look up using email -> some other problem\",\"destinationResponse\":{\"response\":{\"requestId\":\"142e4#1835b117b76\",\"success\":false,\"errors\":[{\"code\":\"random_marketo_code\",\"message\":\"some other problem\"}]},\"status\":200}}",
"error": "Error occurred [Marketo Transformer]: During lead look up using email -> some other problem",
"statTags": {
"errorCategory": "network",
"errorType": "aborted",
Expand Down
235 changes: 235 additions & 0 deletions test/__tests__/data/mp_input.json
Original file line number Diff line number Diff line change
Expand Up @@ -4037,5 +4037,240 @@
"timestamp": "2020-01-24T11:59:02.402+05:30",
"type": "group"
}
},
{
"destination": {
"Config": {
"apiKey": "9432f11f70f8ce386f5110c8c924b3ec4f825256",
"token": "9432f11f70f8ce386f5110c8c924b3ec4f825256",
"prefixProperties": true,
"useNativeSDK": false,
"groupKeySettings": [
{
"groupKey": "company"
}
]
},
"DestinationDefinition": {
"DisplayName": "Kiss Metrics",
"ID": "1WhbSZ6uA3H5ChVifHpfL2H6sie",
"Name": "MIXPANEL"
},
"Enabled": true,
"ID": "1WhcOCGgj9asZu850HvugU2C3Aq",
"Name": "Kiss Metrics",
"Transformations": []
},
"message": {
"anonymousId": "e6ab2c5e-2cda-44a9-a962-e2f67df78bca",
"channel": "mobile",
"name": "Contact Us",
"context": {
"app": {
"build": "1.0.0",
"name": "RudderLabs Android SDK",
"namespace": "com.rudderlabs.javascript",
"version": "1.0.5"
},
"ip": "0.0.0.0",
"library": {
"name": "RudderLabs JavaScript SDK",
"version": "1.0.5"
},
"locale": "en-GB",
"os": {
"name": "",
"version": ""
},
"screen": {
"density": 2
},
"traits": {},
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36"
},
"integrations": {
"All": true
},
"messageId": "dd266c67-9199-4a52-ba32-f46ddde67312",
"originalTimestamp": "2020-01-24T06:29:02.358Z",
"properties": {
"path": "/tests/html/index2.html",
"referrer": "",
"search": "",
"title": "",
"url": "http://localhost/tests/html/index2.html"
},
"traits": {},
"receivedAt": "2020-01-24T11:59:02.403+05:30",
"request_ip": "[::1]:53708",
"sentAt": "2020-01-24T06:29:02.359Z",
"timestamp": "2020-01-24T11:59:02.402+05:30",
"type": "group",
"userId": "hjikl"
}
},
{
"message": {
"type": "track",
"event": "Application Installed",
"sentAt": "2022-09-05T07:46:26.322Z",
"channel": "mobile",
"timestamp": "",
"context": {
"os": {
"name": "Android",
"version": "12"
},
"app": {
"name": "Sample Kotlin",
"build": "4",
"version": "1.0",
"namespace": "com.example.testapp1mg"
},
"device": {
"id": "39da706ec83d0e90",
"name": "emu64a",
"type": "Android",
"model": "sdk_gphone64_arm64",
"manufacturer": "Google"
},
"locale": "en-US",
"screen": {
"width": 1440,
"height": 2984,
"density": 560
},
"traits": {
"anonymousId": "39da706ec83d0e90"
},
"library": {
"name": "com.rudderstack.android.sdk.core",
"version": "1.7.0"
},
"network": {
"wifi": true,
"carrier": "T-Mobile",
"cellular": true,
"bluetooth": true
},
"timezone": "Asia/Kolkata",
"sessionId": 1662363980,
"userAgent": "Dalvik/2.1.0 (Linux; U; Android Tiramisu Build/TPP2.220218.008)",
"sessionStart": true
},
"rudderId": "3ef1dec3-d729-4830-a394-7b8be6819765",
"messageId": "1662363980287-168cf720-6227-4b56-a98e-c49bdc7279e9",
"properties": {
"build": 4,
"version": "1.0",
"revenue": 12.13
},
"anonymousId": "39da706ec83d0e90",
"integrations": {
"All": true
},
"originalTimestamp": "2022-09-05T07:46:20.290Z"
},
"destination": {
"Config": {
"apiKey": "9432f11f70f8ce386f5110c8c924b3ec4f825256",
"apiSecret": "9432f11f70f8ce386f5110c8c924b3ec4f825256",
"token": "9432f11f70f8ce386f5110c8c924b3ec4f825256",
"prefixProperties": true,
"useNativeSDK": false,
"useNewMapping": true
},
"DestinationDefinition": {
"DisplayName": "Kiss Metrics",
"ID": "1WhbSZ6uA3H5ChVifHpfL2H6sie",
"Name": "MIXPANEL"
},
"Enabled": true,
"ID": "1WhcOCGgj9asZu850HvugU2C3Aq",
"Name": "Kiss Metrics",
"Transformations": []
}
},
{
"message": {
"type": "track",
"event": "Application Installed",
"sentAt": "2022-09-05T07:46:26.322Z",
"channel": "mobile",
"timestamp": "safaff",
"context": {
"os": {
"name": "Android",
"version": "12"
},
"app": {
"name": "Sample Kotlin",
"build": "4",
"version": "1.0",
"namespace": "com.example.testapp1mg"
},
"device": {
"id": "39da706ec83d0e90",
"name": "emu64a",
"type": "Android",
"model": "sdk_gphone64_arm64",
"manufacturer": "Google"
},
"locale": "en-US",
"screen": {
"width": 1440,
"height": 2984,
"density": 560
},
"traits": {
"anonymousId": "39da706ec83d0e90"
},
"library": {
"name": "com.rudderstack.android.sdk.core",
"version": "1.7.0"
},
"network": {
"wifi": true,
"carrier": "T-Mobile",
"cellular": true,
"bluetooth": true
},
"timezone": "Asia/Kolkata",
"sessionId": 1662363980,
"userAgent": "Dalvik/2.1.0 (Linux; U; Android Tiramisu Build/TPP2.220218.008)",
"sessionStart": true
},
"rudderId": "3ef1dec3-d729-4830-a394-7b8be6819765",
"messageId": "1662363980287-168cf720-6227-4b56-a98e-c49bdc7279e9",
"properties": {
"build": 4,
"version": "1.0",
"revenue": 23.45
},
"anonymousId": "39da706ec83d0e90",
"integrations": {
"All": true
},
"originalTimestamp": "2022-09-05T07:46:20.290Z"
},
"destination": {
"Config": {
"apiKey": "9432f11f70f8ce386f5110c8c924b3ec4f825256",
"apiSecret": "9432f11f70f8ce386f5110c8c924b3ec4f825256",
"token": "9432f11f70f8ce386f5110c8c924b3ec4f825256",
"prefixProperties": true,
"useNativeSDK": false,
"useNewMapping": true
},
"DestinationDefinition": {
"DisplayName": "Kiss Metrics",
"ID": "1WhbSZ6uA3H5ChVifHpfL2H6sie",
"Name": "MIXPANEL"
},
"Enabled": true,
"ID": "1WhcOCGgj9asZu850HvugU2C3Aq",
"Name": "Kiss Metrics",
"Transformations": []
}
}
]
Loading

0 comments on commit 1aea7cd

Please sign in to comment.