1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-28 05:03:59 +03:00

Poll /sync with a short timeout while catching up

On first connect, or after a disconnection, poll /sync with timeout=0 until
we get no to_device messages back. This will allow us to figure out whether we
have more to_device messages queued up for us on the server, which in turn will
help us fix a bug with clearing out one-time-keys too quickly.
This commit is contained in:
Richard van der Hoff
2017-02-16 15:21:24 +00:00
parent 777fdfbcfa
commit 597f981fec
2 changed files with 33 additions and 13 deletions

View File

@@ -3132,6 +3132,9 @@ module.exports.CRYPTO_ENABLED = CRYPTO_ENABLED;
* will become the 'since' token for the next call to /sync. Only present if
* <code>state=PREPARED</code> or <code>state=SYNCING</code>.
*
* @param {boolean} data.catchingUp True if we are working our way through a
* backlog of events after connecting. Only present if <code>state=SYNCING</code>.
*
* @example
* matrixClient.on("sync", function(state, prevState, data) {
* switch (state) {