Change order of syncs during linking

This commit is contained in:
Fedor Indutny 2022-03-02 14:53:47 -08:00 committed by GitHub
parent 4f869e7900
commit 3b4106d9dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 142 additions and 90 deletions

View file

@ -2610,7 +2610,7 @@ export default class MessageReceiver
envelope: ProcessedEnvelope,
contacts: Proto.SyncMessage.IContacts
): Promise<void> {
log.info('contact sync');
log.info('MessageReceiver: handleContacts');
const { blob } = contacts;
if (!blob) {
throw new Error('MessageReceiver.handleContacts: blob field was missing');
@ -2631,11 +2631,11 @@ export default class MessageReceiver
contactDetails = contactBuffer.next();
}
const finalEvent = new ContactSyncEvent();
results.push(this.dispatchAndWait(finalEvent));
await Promise.all(results);
const finalEvent = new ContactSyncEvent();
await this.dispatchAndWait(finalEvent);
log.info('handleContacts: finished');
}