Don't promote archived sessions, more logging on error

This commit is contained in:
Scott Nonnenberg 2020-12-09 14:05:11 -08:00 committed by GitHub
parent 1098e59f87
commit 5369950c1d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 161 additions and 48 deletions

View file

@ -589,14 +589,19 @@ export default class OutgoingMessage {
identifier: string,
deviceIdsToRemove: Array<number>
): Promise<void> {
let promise = Promise.resolve();
for (const j in deviceIdsToRemove) {
promise = promise.then(async () => {
const encodedAddress = `${identifier}.${deviceIdsToRemove[j]}`;
return window.textsecure.storage.protocol.removeSession(encodedAddress);
});
}
return promise;
await Promise.all(
deviceIdsToRemove.map(async deviceId => {
const address = new window.libsignal.SignalProtocolAddress(
identifier,
deviceId
);
const sessionCipher = new window.libsignal.SessionCipher(
window.textsecure.storage.protocol,
address
);
await sessionCipher.closeOpenSessionForDevice();
})
);
}
async sendToIdentifier(providedIdentifier: string): Promise<void> {