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
|
@ -73,7 +73,7 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@popperjs/core": "2.9.2",
|
||||
"@signalapp/signal-client": "0.8.4",
|
||||
"@signalapp/signal-client": "0.9.0",
|
||||
"@sindresorhus/is": "0.8.0",
|
||||
"@types/pino": "6.3.6",
|
||||
"@types/pino-multi-stream": "5.1.0",
|
||||
|
|
|
@ -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 ${
|
||||
|
|
|
@ -1651,10 +1651,10 @@
|
|||
react-lifecycles-compat "^3.0.4"
|
||||
warning "^3.0.0"
|
||||
|
||||
"@signalapp/signal-client@0.8.4":
|
||||
version "0.8.4"
|
||||
resolved "https://registry.yarnpkg.com/@signalapp/signal-client/-/signal-client-0.8.4.tgz#fd633af5f821f06bb29c205bdcf660cd2bfbecd8"
|
||||
integrity sha512-ae2ohILHNs+F1eDBoCeger2/iffMNDR8uIzp5hAa6szI3WZrf544M1d3jz8XDNejrXarSUmJ74jlsVeDMg12Ng==
|
||||
"@signalapp/signal-client@0.9.0":
|
||||
version "0.9.0"
|
||||
resolved "https://registry.yarnpkg.com/@signalapp/signal-client/-/signal-client-0.9.0.tgz#af7e984b51131b5bb984661494cde0f9ebfd4a61"
|
||||
integrity sha512-tT3sOUCUW0uD6Z2eCHrO2dtmhgkc9JH3NZFIanbuAM1bqyXeZoaqAZauRbTSI0p51RGmqHrT7wg/Nvh8bi9UeA==
|
||||
dependencies:
|
||||
node-gyp-build "^4.2.3"
|
||||
uuid "^8.3.0"
|
||||
|
|
Loading…
Add table
Reference in a new issue