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({
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',
},
],
})}
</>
);
}

View file

@ -561,6 +561,10 @@ function renderChangeDetail<T extends string | JSX.Element>(
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', {

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
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

View file

@ -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)