Skip to content

Commit

Permalink
Merge branch 'develop' into feat.pinterest_tag
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsSudip authored Oct 17, 2024
2 parents e29f3e2 + d730daf commit 69fe7b3
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 10 deletions.
14 changes: 8 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"json-size": "^1.0.0",
"jsontoxml": "^1.0.1",
"jstoxml": "^5.0.2",
"koa": "^2.14.1",
"koa": "^2.15.3",
"koa-bodyparser": "^4.4.0",
"koa2-swagger-ui": "^5.7.0",
"libphonenumber-js": "^1.11.1",
Expand Down Expand Up @@ -128,7 +128,7 @@
"@types/fast-json-stable-stringify": "^2.1.0",
"@types/jest": "^29.5.1",
"@types/jsonpath": "^0.2.4",
"@types/koa": "^2.13.6",
"@types/koa": "^2.15.0",
"@types/koa-bodyparser": "^4.3.10",
"@types/lodash": "^4.14.197",
"@types/node": "^20.2.5",
Expand Down
2 changes: 1 addition & 1 deletion src/cdk/v2/destinations/intercom/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ const filterCustomAttributes = (payload, type, destination, message) => {
let customAttributes = { ...get(payload, 'custom_attributes') };
if (customAttributes) {
ReservedAttributesList.forEach((trait) => {
if (customAttributes[trait]) delete customAttributes[trait];
if (trait in customAttributes) delete customAttributes[trait];
});
if (isDefinedAndNotNull(customAttributes) && Object.keys(customAttributes).length > 0) {
customAttributes =
Expand Down
12 changes: 12 additions & 0 deletions src/cdk/v2/destinations/intercom/utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,18 @@ describe('filterCustomAttributes utility test', () => {
expect(result).toBeUndefined();
});

it('Should filter out custom attributes that are reserved attributes and that are false', () => {
const payload = { custom_attributes: { unsubscribedFromEmails: false } };
const result = filterCustomAttributes(payload, 'user', { Config: { apiVersion: 'v2' } });
expect(result).toBeUndefined();
});

it('Should filter out custom attributes that are reserved attributes and that are null', () => {
const payload = { custom_attributes: { unsubscribedFromEmails: null } };
const result = filterCustomAttributes(payload, 'user', { Config: { apiVersion: 'v2' } });
expect(result).toBeUndefined();
});

it('Should return a flattened object when custom attributes are not null, not reserved attributes and nested', () => {
const payload = {
custom_attributes: { source: 'rudder-js-sdk', data: { nestedAttribute: 'nestedValue' } },
Expand Down
2 changes: 1 addition & 1 deletion src/warehouse/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const whExtractEventTableColumnMappingRules = require('./config/WHExtractEventTa
const maxColumnsInEvent = parseInt(process.env.WH_MAX_COLUMNS_IN_EVENT || '200', 10);

const WH_POPULATE_SRC_DEST_INFO_IN_CONTEXT =
process.env.WH_POPULATE_SRC_DEST_INFO_IN_CONTEXT || true;
process.env.WH_POPULATE_SRC_DEST_INFO_IN_CONTEXT !== 'false';

const getDataType = (key, val, options, jsonKey = false) => {
const type = typeof val;
Expand Down

0 comments on commit 69fe7b3

Please sign in to comment.