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: ensure messages are always ordered #268

Merged
merged 1 commit into from
Sep 15, 2023
Merged

Conversation

fryorcraken
Copy link
Collaborator

Also:

  • remove messages that have a timestamp further than tomorrow.
  • remove dupes

Also:
- remove messages that have a timestamp further than tomorrow.
- remove dupes
@fryorcraken fryorcraken requested a review from a team as a code owner September 13, 2023 06:12
(left, right) => left.timestamp.getTime() - right.timestamp.getTime()
);
// Filter out messages that are "sent" tomorrow are they are likely to be flukes
.filter((m) => m.timestamp.valueOf() < tomorrow.valueOf());
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: more idiomatic way would be to use .sort & .reduce

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ooh, interesting. Will check how I can make it work thx

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure where you would .reduce

@fryorcraken fryorcraken merged commit b11300c into master Sep 15, 2023
8 checks passed
@fryorcraken fryorcraken deleted the fix/web-chat-msg-order branch September 15, 2023 03:28
@danisharora099
Copy link
Contributor

thanks for this!

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.

None yet

3 participants