From bcca23bac93f6337926f1132ac7c639adf1c4fea Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 25 Sep 2020 10:44:29 +0200 Subject: [PATCH] retry sync on timeout, even for incremental sync --- src/matrix/Sync.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/matrix/Sync.js b/src/matrix/Sync.js index 678578e1..cee8347d 100644 --- a/src/matrix/Sync.js +++ b/src/matrix/Sync.js @@ -119,6 +119,11 @@ export class Sync { this._status.set(SyncStatus.Syncing); } } catch (err) { + // retry same request on timeout + if (err.name === "ConnectionError" && err.isTimeout) { + // don't run afterSyncCompleted + continue; + } this._status.set(SyncStatus.Stopped); if (err.name !== AbortError) { console.warn("stopping sync because of error");