Skip to content

Commit

Permalink
Pass through PREPARED state after error, when keepalive returns succes.
Browse files Browse the repository at this point in the history
This is according to the state diagram in client.js.
This will show a spinner at the bottom of a room again
while the catchup sync is in progress,
which seems to have broken at some point.
  • Loading branch information
bwindels committed Aug 28, 2018
1 parent a7199a3 commit beccb8f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,13 @@ SyncApi.prototype._onSyncError = function(err, syncOptions) {
// instead, so that clients can observe this state
// if they wish.
this._startKeepAlives().then(() => {
if (this.getSyncState() == 'ERROR') {
this._updateSyncState("PREPARED", {
oldSyncToken: null,
nextSyncToken: null,
catchingUp: true,
});
}
this._sync(syncOptions);
});

Expand Down

0 comments on commit beccb8f

Please sign in to comment.