Skip to content

Commit

Permalink
FB util file renamed and fixed originalTimestamp override (#488)
Browse files Browse the repository at this point in the history
* fixed util file name mismatch

* prevent originalTimestamp override

* Update utils/EventRepository.js

Co-authored-by: Sai Kumar Battinoju <[email protected]>

* Minor formatting issue fixed

Co-authored-by: Sai Kumar Battinoju <[email protected]>
Co-authored-by: saikumarrs <[email protected]>
  • Loading branch information
3 people authored Apr 7, 2022
1 parent 7ca4eac commit 538e0bf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
4 changes: 0 additions & 4 deletions integrations/FacebookPixel/util.js

This file was deleted.

9 changes: 9 additions & 0 deletions integrations/FacebookPixel/utils.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
function getEventId(message) {
return (
message.traits.event_id ||
message.context.traits.event_id ||
message.properties.event_id ||
message.messageId
);
}
export default getEventId;
3 changes: 2 additions & 1 deletion utils/EventRepository.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ class EventRepository {
*/
enqueue(rudderElement, type) {
const message = rudderElement.getElementContent();
message.originalTimestamp = getCurrentTimeFormatted();
message.originalTimestamp =
message.originalTimestamp || getCurrentTimeFormatted();
message.sentAt = getCurrentTimeFormatted(); // add this, will get modified when actually being sent

// check message size, if greater log an error
Expand Down

0 comments on commit 538e0bf

Please sign in to comment.