Skip to content

Clevertap: timestamp fix - #800

Merged
utsabc merged 7 commits into
masterfrom
clevertap-timestamp-fix
Oct 13, 2021
Merged

utsabc merged 7 commits into
masterfrom
clevertap-timestamp-fix

Conversation

@akashrpo

@akashrpo akashrpo commented Oct 4, 2021

Copy link
Copy Markdown
Contributor

Description of the change

Description here

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Related issues

Fix #1

Checklists

Development

  • Lint rules pass locally
  • The code changed/added as part of this pull request has been covered with tests
  • All tests related to the changed code pass in development

Code review

  • This pull request has a descriptive title and information useful to a reviewer. There may be a screenshot or screencast attached
  • "Ready for review" label attached to the PR and reviewers mentioned in a comment
  • Changes have been reviewed by at least one other engineer
  • Issue from task tracker has a link to this pull request

@akashrpo
akashrpo requested a review from utsabc October 4, 2021 09:33
Comment thread v0/destinations/clevertap/transform.js Outdated
// If timestamp is not in unix format
if (eventPayload.ts && !Number(eventPayload.ts)) {
eventPayload.ts = toUnixTimestamp(eventPayload.ts);
}

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.

Let's do one thing instead of making changes in multiple locations, let's do this change just before Line no 261 in eventPayload

Comment thread v0/destinations/clevertap/transform.js Outdated
["checkout_id", "revenue", "products"]
);

if (eventPayload.evtData.ts && !Number(eventPayload.evtData.ts)) {

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.

This is not required we are not setting ts in evtData

@utsabc utsabc left a comment

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.

LGTM good to merge

@utsabc
utsabc requested a review from saikumarrs October 11, 2021 09:13

@saikumarrs saikumarrs left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM except for the one suggestion below

Comment on lines +103 to +107

// If timestamp is not in unix format
if (payload.d[0].ts && !Number(payload.d[0].ts)) {
payload.d[0].ts = toUnixTimestamp(payload.d[0].ts);
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Rather than having this logic in multiple places (here, above method and in other places), it would be better to remove from all the places and put it after Ln 260.

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.

Yeah we can do that but for the identify calls we push the response to responseWrapper directly and return from there that's why put the ts in mapIdentifyPayloadWithObjectId and mapIdentifyPayload but yeah for other calls we can have it in 260

@akashrpo lets do this change

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Agreed. In that case, no changes would be required.

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.

3 participants