Skip to content

made changes for heap - #229

Merged
sayan-mitra merged 7 commits into
masterfrom
heapFixes
Aug 3, 2020
Merged

sayan-mitra merged 7 commits into
masterfrom
heapFixes

Conversation

@ruchiramoitra

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread v0/destinations/heap/transform.js Outdated
rudderPropertiesObj = message.properties;
rawPayload.identity = message.context.traits.email;
email =
(message.context.traits ? email : null) || message.properties.email;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(message.context.traits ? email : null) ==> email is undefined here right?
so rawPayload.identity = null is valid but rawPayload.identity = undefined (previous version) is not?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed the logic

Comment thread v0/destinations/heap/transform.js Outdated
: null;
email =
message.context.traits.email ||
(message.properties ? message.properties.email : null);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will identify have message.properties?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

properties can be sent through identify calls right?
Thus checking once and then assigning.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we have that provision in our sdks?

Comment thread v0/destinations/heap/transform.js Outdated
} = require("../util");

function responseBuilder(payload, message, heapConfig) {
function flatten(target, opts) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

heap needs flattened properties?
we are not using opts, can this be removed? Also, move this method to utils?
can we have a description and an example of what it does with javascript object, object array and array types

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this function is also used in another destination Kissmetrics. there opts is used so making it generic and keeping it in utils also adding comments.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes heap was not accepting nested properties.

@sayan-mitra
sayan-mitra changed the base branch from master to develop August 3, 2020 11:32
@sayan-mitra
sayan-mitra changed the base branch from develop to master August 3, 2020 11:32
@sayan-mitra

Copy link
Copy Markdown
Contributor

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants