From 8d68a4ab52e28e14d3710c7638a9b633b2ae7413 Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 7 Apr 2020 12:07:41 +0100 Subject: [PATCH] Don't try to send presence updates until the client is started Otherwise we can start making API reqiests which can fail which can trigger things like the soft logout code. Fixes https://github.com/vector-im/riot-web/issues/12943 --- src/Lifecycle.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Lifecycle.js b/src/Lifecycle.js index b9fbf4f1bc..6dabdc0912 100644 --- a/src/Lifecycle.js +++ b/src/Lifecycle.js @@ -578,9 +578,6 @@ async function startMatrixClient(startSyncing=true) { UserActivity.sharedInstance().start(); TypingStore.sharedInstance().reset(); // just in case ToastStore.sharedInstance().reset(); - if (!SettingsStore.getValue("lowBandwidth")) { - Presence.start(); - } DMRoomMap.makeShared().start(); IntegrationManagers.sharedInstance().startWatching(); ActiveWidgetStore.start(); @@ -603,6 +600,11 @@ async function startMatrixClient(startSyncing=true) { // This needs to be started after crypto is set up DeviceListener.sharedInstance().start(); + // Similarly, don't start sending presence updates until we've started + // the client + if (!SettingsStore.getValue("lowBandwidth")) { + Presence.start(); + } // dispatch that we finished starting up to wire up any other bits // of the matrix client that cannot be set prior to starting up.