diff --git a/ts/components/conversation/GroupV2Change.stories.tsx b/ts/components/conversation/GroupV2Change.stories.tsx index e4cdddeec50..7693d2cde63 100644 --- a/ts/components/conversation/GroupV2Change.stories.tsx +++ b/ts/components/conversation/GroupV2Change.stories.tsx @@ -1094,7 +1094,6 @@ export function PendingRemoveOne(): JSX.Element { }, ], })} - {renderChange({ from: CONTACT_B, details: [ @@ -1115,7 +1114,6 @@ export function PendingRemoveOne(): JSX.Element { }, ], })} - {renderChange({ from: CONTACT_C, details: [ @@ -1145,7 +1143,6 @@ export function PendingRemoveOne(): JSX.Element { }, ], })} - {renderChange({ from: OUR_ACI, details: [ @@ -1172,6 +1169,23 @@ export function PendingRemoveOne(): JSX.Element { }, ], })} + no from field or invitee + {renderChange({ + details: [ + { + type: 'pending-remove-one', + inviter: OUR_ACI, + }, + ], + })} + no from field, invitee, or inviter + {renderChange({ + details: [ + { + type: 'pending-remove-one', + }, + ], + })} ); } diff --git a/ts/groupChange.ts b/ts/groupChange.ts index b57c3362b1b..9ff481d5e1a 100644 --- a/ts/groupChange.ts +++ b/ts/groupChange.ts @@ -561,6 +561,10 @@ function renderChangeDetail( const sentByInvited = Boolean(from && from === serviceId); const sentByInviter = Boolean(from && inviter && from === inviter); + if (!serviceId) { + return i18n('icu:GroupV2--pending-remove--decline--unknown'); + } + if (weAreInviter) { if (sentByInvited) { return i18n('icu:GroupV2--pending-remove--decline--you', { diff --git a/ts/groups.ts b/ts/groups.ts index 025b8c0567a..1feece2ec40 100644 --- a/ts/groups.ts +++ b/ts/groups.ts @@ -200,7 +200,7 @@ type GroupV2PendingAddManyChangeType = { // Note: pending-remove is only used if user didn't also join the group at the same time type GroupV2PendingRemoveOneChangeType = { type: 'pending-remove-one'; - serviceId: ServiceIdString; + serviceId?: ServiceIdString; inviter?: AciString; }; // Note: pending-remove is only used if user didn't also join the group at the same time diff --git a/ts/services/backups/import.ts b/ts/services/backups/import.ts index 194dcf0adfc..77282424f5e 100644 --- a/ts/services/backups/import.ts +++ b/ts/services/backups/import.ts @@ -2969,12 +2969,9 @@ export class BackupImportStream extends Writable { } if (update.groupInvitationDeclinedUpdate) { const { inviterAci, inviteeAci } = update.groupInvitationDeclinedUpdate; - if (!inviteeAci || Bytes.isEmpty(inviteeAci)) { - throw new Error( - `${logId}: groupInvitationDeclinedUpdate had missing inviteeAci!` - ); - } - from = fromAciObject(Aci.fromUuidBytes(inviteeAci)); + from = Bytes.isNotEmpty(inviteeAci) + ? fromAciObject(Aci.fromUuidBytes(inviteeAci)) + : undefined; details.push({ type: 'pending-remove-one', inviter: Bytes.isNotEmpty(inviterAci)