Allow empty inviteeAci field when importing GroupInvitationDeclinedUpdate update messages

This commit is contained in:
trevor-signal 2025-09-19 14:26:01 -04:00 committed by GitHub
commit 55e8e4376b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 25 additions and 10 deletions

View file

@ -1094,7 +1094,6 @@ export function PendingRemoveOne(): JSX.Element {
}, },
], ],
})} })}
{renderChange({ {renderChange({
from: CONTACT_B, from: CONTACT_B,
details: [ details: [
@ -1115,7 +1114,6 @@ export function PendingRemoveOne(): JSX.Element {
}, },
], ],
})} })}
{renderChange({ {renderChange({
from: CONTACT_C, from: CONTACT_C,
details: [ details: [
@ -1145,7 +1143,6 @@ export function PendingRemoveOne(): JSX.Element {
}, },
], ],
})} })}
{renderChange({ {renderChange({
from: OUR_ACI, from: OUR_ACI,
details: [ 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',
},
],
})}
</> </>
); );
} }

View file

@ -561,6 +561,10 @@ function renderChangeDetail<T extends string | JSX.Element>(
const sentByInvited = Boolean(from && from === serviceId); const sentByInvited = Boolean(from && from === serviceId);
const sentByInviter = Boolean(from && inviter && from === inviter); const sentByInviter = Boolean(from && inviter && from === inviter);
if (!serviceId) {
return i18n('icu:GroupV2--pending-remove--decline--unknown');
}
if (weAreInviter) { if (weAreInviter) {
if (sentByInvited) { if (sentByInvited) {
return i18n('icu:GroupV2--pending-remove--decline--you', { return i18n('icu:GroupV2--pending-remove--decline--you', {

View file

@ -200,7 +200,7 @@ type GroupV2PendingAddManyChangeType = {
// Note: pending-remove is only used if user didn't also join the group at the same time // Note: pending-remove is only used if user didn't also join the group at the same time
type GroupV2PendingRemoveOneChangeType = { type GroupV2PendingRemoveOneChangeType = {
type: 'pending-remove-one'; type: 'pending-remove-one';
serviceId: ServiceIdString; serviceId?: ServiceIdString;
inviter?: AciString; inviter?: AciString;
}; };
// Note: pending-remove is only used if user didn't also join the group at the same time // Note: pending-remove is only used if user didn't also join the group at the same time

View file

@ -2969,12 +2969,9 @@ export class BackupImportStream extends Writable {
} }
if (update.groupInvitationDeclinedUpdate) { if (update.groupInvitationDeclinedUpdate) {
const { inviterAci, inviteeAci } = update.groupInvitationDeclinedUpdate; const { inviterAci, inviteeAci } = update.groupInvitationDeclinedUpdate;
if (!inviteeAci || Bytes.isEmpty(inviteeAci)) { from = Bytes.isNotEmpty(inviteeAci)
throw new Error( ? fromAciObject(Aci.fromUuidBytes(inviteeAci))
`${logId}: groupInvitationDeclinedUpdate had missing inviteeAci!` : undefined;
);
}
from = fromAciObject(Aci.fromUuidBytes(inviteeAci));
details.push({ details.push({
type: 'pending-remove-one', type: 'pending-remove-one',
inviter: Bytes.isNotEmpty(inviterAci) inviter: Bytes.isNotEmpty(inviterAci)