diff --git a/js/conversation_controller.js b/js/conversation_controller.js index dd123f2c2..d52278fc2 100644 --- a/js/conversation_controller.js +++ b/js/conversation_controller.js @@ -270,13 +270,14 @@ this._initialFetchComplete = true; const promises = []; conversations.forEach(conversation => { - // TODO This needs to be synchronous (one after the other) - promises.concat([ - conversation.updateLastMessage(), - conversation.updateProfile(), - conversation.updateProfileAvatar(), - conversation.resetPendingSend(), - ]); + promises.push(async () => { + // We need to await each one as + // we don't want to simultaneously call writes on the sql database + await conversation.updateLastMessage(); + await conversation.updateProfile(); + await conversation.updateProfileAvatar(); + await conversation.resetPendingSend(); + }); }); await Promise.all(promises);