From e0ae5fc27c531bf833d7c2d73ba8ea981e579b95 Mon Sep 17 00:00:00 2001 From: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com> Date: Tue, 20 Sep 2022 16:53:38 -0700 Subject: [PATCH] Wait for contact sync in MessageReceiver --- ts/textsecure/MessageReceiver.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ts/textsecure/MessageReceiver.ts b/ts/textsecure/MessageReceiver.ts index 57cae95ac2..783c473dd1 100644 --- a/ts/textsecure/MessageReceiver.ts +++ b/ts/textsecure/MessageReceiver.ts @@ -2745,11 +2745,10 @@ export default class MessageReceiver return this.handleSentMessage(envelope, sentMessage); } if (syncMessage.contacts) { - // Note: we do not return here because we don't want to block the next - // message on this attachment download and a lot of processing of that - // attachment. - this.handleContacts(envelope, syncMessage.contacts); - return; + // Note: this method will download attachment and thus might block + // message processing, but we would like to fully process contact sync + // before moving on since it updates conversation state. + return this.handleContacts(envelope, syncMessage.contacts); } if (syncMessage.groups) { this.handleGroups(envelope, syncMessage.groups);