Skip to content

Commit

Permalink
chore(release): pull hotfix-release/v1.65.0 into main (#3346)
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsSudip authored May 6, 2024
2 parents 129a0a1 + 5d58abd commit ead770d
Show file tree
Hide file tree
Showing 12 changed files with 1,795 additions and 1,277 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@

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.65.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.64.0...v1.65.0) (2024-05-06)


### Features

* generate anonymousId and move to component testcases ([447f85f](https://github.com/rudderlabs/rudder-transformer/commit/447f85faf6ccca2179ab33b7fe43e281fc4f5897))


### Bug Fixes

* auth0 error handling ([2e22075](https://github.com/rudderlabs/rudder-transformer/commit/2e22075ddf792c573642fd09c5f9d31d8132525b))
* auth0 error handling for missing userId ([#3334](https://github.com/rudderlabs/rudder-transformer/issues/3334)) ([d2cce77](https://github.com/rudderlabs/rudder-transformer/commit/d2cce772d6f0485ff8ee51af261006eb2066c3a2))
* braze dedup for non-billable attributes ([#3320](https://github.com/rudderlabs/rudder-transformer/issues/3320)) ([ac59fdc](https://github.com/rudderlabs/rudder-transformer/commit/ac59fdc37d6fe08847d79d249d166de7cc358fd6))
* multiple event mappings in ortto ([#3341](https://github.com/rudderlabs/rudder-transformer/issues/3341)) ([0a9a2e9](https://github.com/rudderlabs/rudder-transformer/commit/0a9a2e9e2a3029ad7b4834820ba2132d3f57ce98))

## [1.64.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.63.0...v1.64.0) (2024-04-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.64.0",
"version": "1.65.0",
"description": "",
"homepage": "https://github.com/rudderlabs/rudder-transformer#readme",
"bugs": {
Expand Down
5 changes: 1 addition & 4 deletions src/cdk/v2/destinations/ortto/procWorkflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,8 @@ steps:
steps:
- name: getTrimmedEvent
template: |
let customEvent = "";
const event = .message.event;
.destination.Config.orttoEventsMapping@order.(
customEvent = event === .rsEventName ? .orttoEventName : null;
)
const customEvent = .destination.Config.orttoEventsMapping.{.rsEventName === event}.orttoEventName;
$.assert(customEvent, "Event names is not mapped");
"act:cm:"+customEvent.trim().toLowerCase().replace(new RegExp('\\s+', 'g'),'-');
Expand Down
4 changes: 2 additions & 2 deletions src/v0/destinations/braze/braze.util.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ describe('dedup utility tests', () => {
});
});

test('returns null if all keys are in BRAZE_NON_BILLABLE_ATTRIBUTES', () => {
test('returns only non-billable attribute if there is key of BRAZE_NON_BILLABLE_ATTRIBUTES', () => {
const userData = {
external_id: '123',
country: 'US',
Expand All @@ -757,7 +757,7 @@ describe('dedup utility tests', () => {
};
store.set('123', storeData);
const result = BrazeDedupUtility.deduplicate(userData, store);
expect(result).toBeNull();
expect(result).toEqual({ country: 'US', external_id: '123', language: 'en' });
});

test('returns null if all keys have $add, $update, or $remove properties', () => {
Expand Down
22 changes: 10 additions & 12 deletions src/v0/destinations/braze/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const {
const { JSON_MIME_TYPE, HTTP_STATUS_CODES } = require('../../util/constant');
const { isObject } = require('../../util');
const { removeUndefinedValues, getIntegrationsObj } = require('../../util');
const { InstrumentationError } = require('@rudderstack/integrations-lib');
const { InstrumentationError, isDefined } = require('@rudderstack/integrations-lib');

const getEndpointFromConfig = (destination) => {
// Init -- mostly for test cases
Expand Down Expand Up @@ -284,12 +284,17 @@ const BrazeDedupUtility = {
return true;
});

if (keys.length === 0) {
return null;
if (keys.length > 0) {
keys.forEach((key) => {
if (!_.isEqual(userData[key], storedUserData[key])) {
deduplicatedUserData[key] = userData[key];
}
});
}

keys.forEach((key) => {
if (!_.isEqual(userData[key], storedUserData[key])) {
// add non billable attributes back to the deduplicated user object
BRAZE_NON_BILLABLE_ATTRIBUTES.forEach((key) => {
if (isDefined(userData[key])) {
deduplicatedUserData[key] = userData[key];
}
});
Expand All @@ -305,13 +310,6 @@ const BrazeDedupUtility = {
const identifier = external_id || user_alias?.alias_name;
store.set(identifier, { ...storedUserData, ...deduplicatedUserData });

// add non billable attributes back to the deduplicated user object
BRAZE_NON_BILLABLE_ATTRIBUTES.forEach((key) => {
if (isDefinedAndNotNull(userData[key])) {
deduplicatedUserData[key] = userData[key];
}
});

return removeUndefinedValues(deduplicatedUserData);
},
};
Expand Down
18 changes: 7 additions & 11 deletions src/v0/sources/auth0/transform.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
const path = require('path');
const fs = require('fs');
const { InstrumentationError } = require('@rudderstack/integrations-lib');
const { removeUndefinedAndNullValues } = require('../../util');
const { getGroupId } = require('./util');
// import mapping json using JSON.parse to preserve object key order
const mapping = JSON.parse(fs.readFileSync(path.resolve(__dirname, './mapping.json'), 'utf-8'));
const Message = require('../message');
const { generateUUID } = require('../../util');

// Ref: https://auth0.com/docs/logs/references/log-event-type-codes
const eventNameMap = JSON.parse(
Expand Down Expand Up @@ -59,11 +59,11 @@ function processEvents(eventList) {
} else {
response = prepareTrackPayload(data);
}
if (response?.userId) {
// eslint-disable-next-line camelcase
response.properties.log_id = log_id;
responses.push(removeUndefinedAndNullValues(response));
}

// eslint-disable-next-line camelcase
response.properties.log_id = log_id;
response.anonymousId = generateUUID();
responses.push(removeUndefinedAndNullValues(response));
}
});
return responses;
Expand All @@ -74,11 +74,7 @@ function process(events) {
if (!Array.isArray(events)) {
eventList = events.logs || [events];
}
const responses = processEvents(eventList);
if (responses.length === 0) {
throw new InstrumentationError('UserId is not present');
}
return responses;
return processEvents(eventList);
}

exports.process = process;
23 changes: 0 additions & 23 deletions test/__tests__/auth0_source.test.js

This file was deleted.

Loading

0 comments on commit ead770d

Please sign in to comment.