diff --git a/src/client.js b/src/client.js index 1f3a48130..3e076480c 100644 --- a/src/client.js +++ b/src/client.js @@ -3504,6 +3504,12 @@ module.exports.CRYPTO_ENABLED = CRYPTO_ENABLED; * a state of SYNCING. This is the equivalent of "syncComplete" in the * previous API. * + *
  • CATCHUP: The client has detected the connection to the server might be + * available again and will now try to do a sync again. As this sync might take + * a long time (depending how long ago was last synced, and general server + * performance) the client is put in this mode so the UI can reflect trying + * to catch up with the server after losing connection.
  • + * *
  • SYNCING : The client is currently polling for new events from the server. * This will be called after processing latest events from a sync.
  • * @@ -3527,11 +3533,11 @@ module.exports.CRYPTO_ENABLED = CRYPTO_ENABLED; * +---->STOPPED * | * +----->PREPARED -------> SYNCING <--+ - * | ^ | ^ | - * | | | | | - * | | V | | - * null ------+ | +--------RECONNECTING | - * | | V | + * | ^ | ^ | + * | CATCHUP ----------+ | | | + * | ^ V | | + * null ------+ | +------- RECONNECTING | + * | V V | * +------->ERROR ---------------------+ * * NB: 'null' will never be emitted by this event. diff --git a/src/sync.js b/src/sync.js index 3b8d031e2..1a4566db2 100644 --- a/src/sync.js +++ b/src/sync.js @@ -781,7 +781,7 @@ SyncApi.prototype._onSyncError = function(err, syncOptions) { // if they wish. this._startKeepAlives().then(() => { if (this.getSyncState() === 'ERROR') { - this._updateSyncState("PREPARED", { + this._updateSyncState("CATCHUP", { oldSyncToken: null, nextSyncToken: null, catchingUp: true,