On Sender Key distribution message failure, don't update send status
This commit is contained in:
parent
db523f0684
commit
e09d148c1d
4 changed files with 43 additions and 13 deletions
|
@ -412,18 +412,31 @@ export async function sendToGroupViaSenderKey(options: {
|
|||
newToMemberUuids.length
|
||||
} members: ${JSON.stringify(newToMemberUuids)}`
|
||||
);
|
||||
await handleMessageSend(
|
||||
window.textsecure.messaging.sendSenderKeyDistributionMessage(
|
||||
{
|
||||
contentHint: ContentHint.RESENDABLE,
|
||||
distributionId,
|
||||
groupId,
|
||||
identifiers: newToMemberUuids,
|
||||
},
|
||||
sendOptions ? { ...sendOptions, online: false } : undefined
|
||||
),
|
||||
{ messageIds: [], sendType: 'senderKeyDistributionMessage' }
|
||||
);
|
||||
try {
|
||||
await handleMessageSend(
|
||||
window.textsecure.messaging.sendSenderKeyDistributionMessage(
|
||||
{
|
||||
contentHint: ContentHint.RESENDABLE,
|
||||
distributionId,
|
||||
groupId,
|
||||
identifiers: newToMemberUuids,
|
||||
},
|
||||
sendOptions ? { ...sendOptions, online: false } : undefined
|
||||
),
|
||||
{ messageIds: [], sendType: 'senderKeyDistributionMessage' }
|
||||
);
|
||||
} catch (error) {
|
||||
// If we partially fail to send the sender key distribution message (SKDM), we don't
|
||||
// want the successful SKDM sends to be considered an overall success.
|
||||
if (error instanceof SendMessageProtoError) {
|
||||
throw new SendMessageProtoError({
|
||||
...error,
|
||||
sendIsNotFinal: true,
|
||||
});
|
||||
}
|
||||
|
||||
throw error;
|
||||
}
|
||||
|
||||
// Update memberDevices with new devices
|
||||
const updatedMemberDevices = [...memberDevices, ...newToMemberDevices];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue