You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-29 16:43:09 +03:00
use CATCHUP state after ERROR before going back to SYNCING
This commit is contained in:
@@ -3504,6 +3504,12 @@ module.exports.CRYPTO_ENABLED = CRYPTO_ENABLED;
|
|||||||
* a state of SYNCING. <i>This is the equivalent of "syncComplete" in the
|
* a state of SYNCING. <i>This is the equivalent of "syncComplete" in the
|
||||||
* previous API.</i></li>
|
* previous API.</i></li>
|
||||||
*
|
*
|
||||||
|
* <li>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.</li>
|
||||||
|
*
|
||||||
* <li>SYNCING : The client is currently polling for new events from the server.
|
* <li>SYNCING : The client is currently polling for new events from the server.
|
||||||
* This will be called <i>after</i> processing latest events from a sync.</li>
|
* This will be called <i>after</i> processing latest events from a sync.</li>
|
||||||
*
|
*
|
||||||
@@ -3527,11 +3533,11 @@ module.exports.CRYPTO_ENABLED = CRYPTO_ENABLED;
|
|||||||
* +---->STOPPED
|
* +---->STOPPED
|
||||||
* |
|
* |
|
||||||
* +----->PREPARED -------> SYNCING <--+
|
* +----->PREPARED -------> SYNCING <--+
|
||||||
* | ^ | ^ |
|
* | ^ | ^ |
|
||||||
* | | | | |
|
* | CATCHUP ----------+ | | |
|
||||||
* | | V | |
|
* | ^ V | |
|
||||||
* null ------+ | +--------RECONNECTING |
|
* null ------+ | +------- RECONNECTING |
|
||||||
* | | V |
|
* | V V |
|
||||||
* +------->ERROR ---------------------+
|
* +------->ERROR ---------------------+
|
||||||
*
|
*
|
||||||
* NB: 'null' will never be emitted by this event.
|
* NB: 'null' will never be emitted by this event.
|
||||||
|
|||||||
@@ -781,7 +781,7 @@ SyncApi.prototype._onSyncError = function(err, syncOptions) {
|
|||||||
// if they wish.
|
// if they wish.
|
||||||
this._startKeepAlives().then(() => {
|
this._startKeepAlives().then(() => {
|
||||||
if (this.getSyncState() === 'ERROR') {
|
if (this.getSyncState() === 'ERROR') {
|
||||||
this._updateSyncState("PREPARED", {
|
this._updateSyncState("CATCHUP", {
|
||||||
oldSyncToken: null,
|
oldSyncToken: null,
|
||||||
nextSyncToken: null,
|
nextSyncToken: null,
|
||||||
catchingUp: true,
|
catchingUp: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user