Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: sentAt set at batch upload time #932

Merged
merged 1 commit into from
Aug 18, 2023
Merged

fix: sentAt set at batch upload time #932

merged 1 commit into from
Aug 18, 2023

Conversation

oscb
Copy link
Contributor

@oscb oscb commented Aug 17, 2023

sentAt is not set at batch upload time once per the whole batch. Individual event sentAt property is stripped when doing batch uploading.

  • [✔︎] I've included a changeset (psst. run yarn changeset. Read about changesets here).

@changeset-bot
Copy link

changeset-bot bot commented Aug 17, 2023

🦋 Changeset detected

Latest commit: 6d63b5e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@segment/analytics-next Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

// Remove sentAt from every event as batching only needs a single timestamp
const updatedBatch = batch.map((event) => {
const { sentAt, ...newEvent } = event as SegmentEvent
return newEvent
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh I like destructuring to do 'omit'. Neat

@oscb oscb merged commit b1584fc into master Aug 18, 2023
3 checks passed
@oscb oscb deleted the oscb/sentAtFix branch August 18, 2023 16:14
@github-actions github-actions bot mentioned this pull request Aug 18, 2023
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