Retry failed signed key rotation; start rotation when registered (#1772)
This commit is contained in:
parent
81565b1ac6
commit
fd5fa666f9
4 changed files with 52 additions and 26 deletions
|
@ -37995,19 +37995,26 @@ var TextSecureServer = (function() {
|
|||
keyId : res.keyId,
|
||||
publicKey : res.keyPair.pubKey,
|
||||
signature : res.signature
|
||||
}).then(function() {
|
||||
textsecure.storage.put('signedKeyId', signedKeyId + 1);
|
||||
textsecure.storage.remove('signedKeyRotationRejected');
|
||||
return store.storeSignedPreKey(res.keyId, res.keyPair).then(function() {
|
||||
return cleanSignedPreKeys();
|
||||
});
|
||||
}).catch(function(e) {
|
||||
if (e instanceof Error && e.name == 'HTTPError' && e.code >= 400 && e.code <= 599) {
|
||||
var rejections = 1 + textsecure.storage.get('signedKeyRotationRejected', 0);
|
||||
textsecure.storage.put('signedKeyRotationRejected', rejections);
|
||||
console.log('Signed key rotation rejected count:', rejections);
|
||||
}
|
||||
});
|
||||
}).then(function() {
|
||||
textsecure.storage.put('signedKeyId', signedKeyId + 1);
|
||||
textsecure.storage.remove('signedKeyRotationRejected');
|
||||
return store.storeSignedPreKey(res.keyId, res.keyPair).then(function() {
|
||||
return cleanSignedPreKeys();
|
||||
});
|
||||
}).catch(function(e) {
|
||||
console.log(
|
||||
'rotateSignedPrekey error:',
|
||||
e && e.stack ? e.stack : e
|
||||
);
|
||||
|
||||
if (e instanceof Error && e.name == 'HTTPError' && e.code >= 400 && e.code <= 599) {
|
||||
var rejections = 1 + textsecure.storage.get('signedKeyRotationRejected', 0);
|
||||
textsecure.storage.put('signedKeyRotationRejected', rejections);
|
||||
console.log('Signed key rotation rejected count:', rejections);
|
||||
}
|
||||
|
||||
throw e;
|
||||
});
|
||||
}.bind(this));
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue