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

/sync returns outdated OTK counts #17491

Open
richvdh opened this issue Jul 26, 2024 · 0 comments
Open

/sync returns outdated OTK counts #17491

richvdh opened this issue Jul 26, 2024 · 0 comments

Comments

@richvdh
Copy link
Member

richvdh commented Jul 26, 2024

Typically, the way that /sync works is this:

  • Assuming that anything at all has changed on the server since the since token, call current_sync_for_user to generate a sync response and new sync token.
  • If nothing has happened in any of the syncing user's rooms, wait for a notification that something interesting has happened.
  • If we get woken up, generate a new sync response and token.
  • If nothing happens in 30 seconds, return the previously-generated response and token.

This means that, if the user is in no active rooms, the entire sync response and token are 30 seconds old.

This is particularly bad if the client uploads some OTKs in that 30-second slot, since the /sync response will include the OTK count from before the upload request.

The upshot of all this is that most clients end up uploading 100 keys when really they only meant to upload 50.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants