From 09cb39b5538da89372b0e7c206ef920af31973f7 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 31 Aug 2020 14:13:36 +0200 Subject: [PATCH] don't run afterSyncCompleted when there was an error --- src/matrix/Sync.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/matrix/Sync.js b/src/matrix/Sync.js index 4da24ba6..5587d2b0 100644 --- a/src/matrix/Sync.js +++ b/src/matrix/Sync.js @@ -100,11 +100,13 @@ export class Sync { this._status.set(SyncStatus.Stopped); } } - try { - await this._session.afterSyncCompleted(); - } catch (err) { - console.err("error during after sync completed, continuing to sync.", err.stack); - // swallowing error here apart from logging + if (!this._error) { + try { + await this._session.afterSyncCompleted(); + } catch (err) { + console.err("error during after sync completed, continuing to sync.", err.stack); + // swallowing error here apart from logging + } } } }