Update to libsignal-client@0.9.0, handle new invalid registration error
This commit is contained in:
parent
9ca9f743c3
commit
5bf3720d1d
3 changed files with 25 additions and 5 deletions
|
@ -5,6 +5,7 @@ import { differenceWith, omit, partition } from 'lodash';
|
|||
import PQueue from 'p-queue';
|
||||
|
||||
import {
|
||||
ErrorCode,
|
||||
groupEncrypt,
|
||||
ProtocolAddress,
|
||||
sealedSenderMultiRecipientEncrypt,
|
||||
|
@ -513,6 +514,25 @@ export async function sendToGroupViaSenderKey(options: {
|
|||
recursionCount: recursionCount + 1,
|
||||
});
|
||||
}
|
||||
if (error.code === ErrorCode.InvalidRegistrationId && error.addr) {
|
||||
const address = error.addr as ProtocolAddress;
|
||||
const name = address.name();
|
||||
|
||||
const brokenAccount = window.ConversationController.get(name);
|
||||
if (brokenAccount) {
|
||||
window.log.warn(
|
||||
`sendToGroupViaSenderKey/${logId}: Disabling sealed sender for ${brokenAccount.idForLogging()}`
|
||||
);
|
||||
brokenAccount.set({ sealedSender: SEALED_SENDER.DISABLED });
|
||||
window.Signal.Data.updateConversation(brokenAccount.attributes);
|
||||
|
||||
// Now that we've eliminate this problematic account, we can try the send again.
|
||||
return sendToGroupViaSenderKey({
|
||||
...options,
|
||||
recursionCount: recursionCount + 1,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
throw new Error(
|
||||
`sendToGroupViaSenderKey/${logId}: Returned unexpected error ${
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue