getProfile errors shouldn't stop group update

Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
This commit is contained in:
automated-signal 2022-03-22 13:53:56 -07:00 committed by GitHub
parent 5ccfbc4aea
commit 63c7f9fd52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 6 deletions

View File

@ -2734,12 +2734,19 @@ async function updateGroup(
const profileFetchQueue = new PQueue({
concurrency: 3,
});
await profileFetchQueue.addAll(
contactsWithoutProfileKey.map(contact => () => {
const active = contact.getActiveProfileFetch();
return active || contact.getProfiles();
})
);
try {
await profileFetchQueue.addAll(
contactsWithoutProfileKey.map(contact => () => {
const active = contact.getActiveProfileFetch();
return active || contact.getProfiles();
})
);
} catch (error) {
log.error(
`updateGroup/${logId}: failed to fetch missing profiles`,
Errors.toLogFormat(error)
);
}
}
if (changeMessagesToSave.length > 0) {