Skip to content
This repository has been archived by the owner on Mar 28, 2023. It is now read-only.

Non-deterministic chat messages #1545

Closed
placer14 opened this issue Apr 15, 2019 · 1 comment · Fixed by #1549
Closed

Non-deterministic chat messages #1545

placer14 opened this issue Apr 15, 2019 · 1 comment · Fixed by #1549
Assignees
Labels

Comments

@placer14
Copy link
Member

When sending a series of closely timed chat messages to a peer, they can easily be presented out-of-order in the UI. We apply timestamps to the messages to ensure they can be deterministically ordered, however, the timestamps only have resolution to the second and it's not unreasonable for multiple chat messages to potentially arrive within the same second.

So we'd like to increase this resolution and understand what the limitation of the new resolution are to handle them appropriately in the future.

@placer14 placer14 added the bug label Apr 15, 2019
@placer14 placer14 self-assigned this Apr 15, 2019
@placer14
Copy link
Member Author

We're going to increase the resolution of the persisted timestamp to use nanoseconds instead of seconds. This requires 64 bits (which sqlite supports) and the time.UnixNano() function will limit this ordering only until the year 2262. (Oh darn.)

placer14 added a commit that referenced this issue Apr 18, 2019
Messages are stored with seconds which cause messages received within
the same second to have non-deterministic ordering. This increased
resolution will allow these messages to maintain proper order.
placer14 added a commit that referenced this issue Apr 18, 2019
Messages are stored with seconds which cause messages received within
the same second to have non-deterministic ordering. This increased
resolution will allow these messages to maintain proper order.
placer14 added a commit that referenced this issue Apr 18, 2019
Messages are stored with seconds which cause messages received within
the same second to have non-deterministic ordering. This increased
resolution will allow these messages to maintain proper order.
hoffmabc pushed a commit that referenced this issue Dec 9, 2019
Messages are stored with seconds which cause messages received within
the same second to have non-deterministic ordering. This increased
resolution will allow these messages to maintain proper order.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant