Fix buildToken including our aci incorrectly

Co-authored-by: Jamie Kyle <113370520+jamiebuilds-signal@users.noreply.github.com>
This commit is contained in:
automated-signal 2024-10-18 13:59:26 -05:00 committed by GitHub
parent 8c7523cf33
commit 76b7d74a3a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -257,8 +257,8 @@ export class GroupSendEndorsementState {
// Fast path sending to one person // Fast path sending to one person
if (serviceIds.size === 1) { if (serviceIds.size === 1) {
log.info(`${logId}: using single member endorsement`);
const [serviceId] = serviceIds; const [serviceId] = serviceIds;
log.info(`${logId}: using single member endorsement (${serviceId})`);
return this.#getMemberEndorsement(serviceId); return this.#getMemberEndorsement(serviceId);
} }
@ -275,15 +275,19 @@ export class GroupSendEndorsementState {
); );
const otherMembers = new Set(difference); const otherMembers = new Set(difference);
const includesOurs = otherMembers.delete(this.#ourAci); const includesOurs = !otherMembers.delete(this.#ourAci);
if (otherMembers.size === 0) { if (otherMembers.size === 0) {
log.info(`${logId}: using combined endorsement`); log.info(
`${logId}: using combined endorsement (includesOurs: ${includesOurs})`
);
return this.#getCombinedEndorsement(includesOurs); return this.#getCombinedEndorsement(includesOurs);
} }
if (otherMembers.size < memberCount / 2) { if (otherMembers.size < memberCount / 2) {
log.info(`${logId}: subtracting missing members`); log.info(
`${logId}: subtracting missing members (includesOurs: ${includesOurs})`
);
return this.#subtractMemberEndorsements(otherMembers, includesOurs); return this.#subtractMemberEndorsements(otherMembers, includesOurs);
} }