Repository navigation
Clevertap: timestamp fix - #800
Conversation
| // If timestamp is not in unix format | ||
| if (eventPayload.ts && !Number(eventPayload.ts)) { | ||
| eventPayload.ts = toUnixTimestamp(eventPayload.ts); | ||
| } |
There was a problem hiding this comment.
Let's do one thing instead of making changes in multiple locations, let's do this change just before Line no 261 in eventPayload
| ["checkout_id", "revenue", "products"] | ||
| ); | ||
|
|
||
| if (eventPayload.evtData.ts && !Number(eventPayload.evtData.ts)) { |
There was a problem hiding this comment.
This is not required we are not setting ts in evtData
|
|
||
| // 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); | ||
| } |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Agreed. In that case, no changes would be required.
Description of the change
Type of change
Related issues
Checklists
Development
Code review