From 8d3ed1a2b78923f428e356619cd80d3bf4ffca62 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Mon, 9 Dec 2024 16:53:43 +1100 Subject: [PATCH] Revert "fix: show invite failed toast even if the first part of update failed" This reverts commit bc62b0ec40ba26b97057182e3609f0b3d60fc772. --- ts/state/ducks/metaGroups.ts | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/ts/state/ducks/metaGroups.ts b/ts/state/ducks/metaGroups.ts index abbfdd244..7df015dda 100644 --- a/ts/state/ducks/metaGroups.ts +++ b/ts/state/ducks/metaGroups.ts @@ -660,16 +660,6 @@ async function handleMemberAddedFromUI({ updateMessagesToPush, group ); - // schedule send invite details, auth signature, etc. to the new users - // those will fail is the pushChangesToGroupSwarmIfNeeded fails, but we still want - // to display the toasts message saying they failed - await scheduleGroupInviteJobs( - groupPk, - withHistory, - withoutHistory, - window.sessionFeatureFlags.useGroupV2InviteAsAdmin - ); - await LibSessionUtil.saveDumpsToDb(groupPk); // push new members & key supplement in a single batch call const sequenceResult = await GroupSync.pushChangesToGroupSwarmIfNeeded({ @@ -679,14 +669,21 @@ async function handleMemberAddedFromUI({ unrevokeSubRequest, extraStoreRequests, }); - await LibSessionUtil.saveDumpsToDb(groupPk); - if (sequenceResult !== RunJobResult.Success) { throw new Error( 'handleMemberAddedFromUIOrNot: pushChangesToGroupSwarmIfNeeded did not return success' ); } + // schedule send invite details, auth signature, etc. to the new users + await scheduleGroupInviteJobs( + groupPk, + withHistory, + withoutHistory, + window.sessionFeatureFlags.useGroupV2InviteAsAdmin + ); + await LibSessionUtil.saveDumpsToDb(groupPk); + convo.set({ active_at: createAtNetworkTimestamp, });