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

Use created at server timestamp #1321

Merged
merged 14 commits into from
Sep 8, 2020

Conversation

Bilb
Copy link
Collaborator

@Bilb Bilb commented Sep 2, 2020

Order messages received by the server created_at timestamp rather than the one included in the message.
This is to prevent messages from a user with an out of sync clock to be able to sent message way in the past or in the future.

Also changes the way we check for duplicates. As we now rely on the server timestamp, we have a difference of timestamp between the message we sent, and the message the server sent us back on pull. This creates two messages on desktop. The way to fix it is to add a timeframe of 10s during a which, a message from a specific user and with the same content will be considered a duplicate, and so will be dropped

Also update the way we check for duplicated message to allow a 10s
window with the same body rather than an exact match of timestamp.

This is needed as the timestamp of the message pulled is now the one of
the creation of the server, and not the same we have locally (sent at).
@Bilb Bilb marked this pull request as draft September 2, 2020 04:50
@Bilb Bilb marked this pull request as ready for review September 4, 2020 05:12
js/models/messages.js Outdated Show resolved Hide resolved
js/modules/loki_app_dot_net_api.js Show resolved Hide resolved
@Bilb Bilb force-pushed the use-created-at-server-timestamp branch from 9bd7d27 to 76664d9 Compare September 4, 2020 05:26
@Bilb Bilb merged commit c34edee into oxen-io:clearnet Sep 8, 2020
@Bilb Bilb deleted the use-created-at-server-timestamp branch September 8, 2020 05:15
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

2 participants