Save prekeys optimistically, track confirms, new clean behavior (#1846)

* Re-enable libtextsecure unit tests, get passing, run in CI

* Save prekeys optimistically, track confirmed, new clean behavior

* Eliminate potential conflicts when rotating on startup

* Remove last symlink: get libtextsecure tests running on windows
This commit is contained in:
Scott Nonnenberg 2017-12-01 13:35:39 -08:00 committed by GitHub
parent 21325bc922
commit c195ba2630
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 433 additions and 147 deletions

View file

@ -79,11 +79,11 @@
function start() {
var currentVersion = window.config.version;
var lastVersion = storage.get('version');
var newVersion = !lastVersion || currentVersion !== lastVersion;
storage.put('version', currentVersion);
if (!lastVersion || currentVersion !== lastVersion) {
if (newVersion) {
console.log('New version detected:', currentVersion);
getAccountManager().rotateSignedPreKey();
}
window.dispatchEvent(new Event('storage_ready'));
@ -91,7 +91,7 @@
console.log('listening for registration events');
Whisper.events.on('registration_done', function() {
console.log('handling registration event');
Whisper.RotateSignedPreKeyListener.init(Whisper.events);
Whisper.RotateSignedPreKeyListener.init(Whisper.events, newVersion);
connect(true);
});
@ -104,7 +104,7 @@
console.log('Import was interrupted, showing import error screen');
appView.openImporter();
} else if (Whisper.Registration.everDone()) {
Whisper.RotateSignedPreKeyListener.init(Whisper.events);
Whisper.RotateSignedPreKeyListener.init(Whisper.events, newVersion);
connect();
appView.openInbox({
initialLoadComplete: initialLoadComplete