Open
Description
Typically, the way that /sync
works is this:
- Assuming that anything at all has changed on the server since the
since
token, callcurrent_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.