Key rotation: log failures, retry, force on new version (#1833)
* Retry failed signed key rotation; start rotation when registered (#1772) * rotateSignedPrekeys: Fix 'res is not defined' error * If the server rejects key rotation, don't retry immediately * Force a signed key rotation on launch of any new version
This commit is contained in:
parent
b8b26d3e79
commit
a5923c2177
4 changed files with 41 additions and 14 deletions
|
@ -38008,13 +38008,20 @@ var TextSecureServer = (function() {
|
|||
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);
|
||||
}
|
||||
});
|
||||
}).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);
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
});
|
||||
}.bind(this));
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue