From 926a04d0458ee4de6725eba7b321e7eeaa37b796 Mon Sep 17 00:00:00 2001
From: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
Date: Tue, 22 Mar 2022 12:00:31 -0700
Subject: [PATCH] getProfile errors shouldn't stop group update

---
 ts/groups.ts | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/ts/groups.ts b/ts/groups.ts
index 0a26f15e1a..daebf8947f 100644
--- a/ts/groups.ts
+++ b/ts/groups.ts
@@ -2879,12 +2879,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) {