Merge branch 'master' into development

Bringing our development (beta) branch inline with all the more urgent
fixes which went directly into the master (production) branch.
This commit is contained in:
Scott Nonnenberg 2017-11-08 17:02:00 -08:00
commit 9e6d50b966
No known key found for this signature in database
GPG key ID: A4931C09644C654B
22 changed files with 1543 additions and 624 deletions

View file

@ -717,7 +717,7 @@
source: deliveryReceipt.source
});
receipt.on('remove', ev.confirm);
ev.confirm();
// Calling this directly so we can wait for completion
return Whisper.DeliveryReceipts.onReceipt(receipt);

View file

@ -178,8 +178,18 @@
console.log('Importing to these stores:', storeNames.join(', '));
var finished = false;
var finish = function(via) {
console.log('non-messages import done via', via);
if (finished) {
resolve();
}
finished = true;
};
var transaction = idb_db.transaction(storeNames, 'readwrite');
transaction.onerror = reject;
transaction.oncomplete = finish.bind(null, 'transaction complete');
_.each(storeNames, function(storeName) {
console.log('Importing items for store', storeName);
@ -202,7 +212,7 @@
if (_.keys(importObject).length === 0) {
// added all object stores
console.log('DB import complete');
resolve();
finish('puts scheduled');
}
}
};
@ -581,6 +591,15 @@
}
return new Promise(function(resolve, reject) {
var finished = false;
var finish = function(via) {
console.log('messages done saving via', via);
if (finished) {
resolve();
}
finished = true;
};
var transaction = idb_db.transaction('messages', 'readwrite');
transaction.onerror = function(e) {
console.log(
@ -589,6 +608,7 @@
);
return reject(e);
};
transaction.oncomplete = finish.bind(null, 'transaction complete');
var store = transaction.objectStore('messages');
var conversationId = messages[0].conversationId;
@ -606,12 +626,12 @@
// Don't know if group or private conversation, so we blindly redact
'[REDACTED]' + conversationId.slice(-3)
);
resolve();
finish('puts scheduled');
}
};
request.onerror = function(event) {
console.log('Error adding object to store:', error);
reject();
console.log('Error adding object to store:', event);
reject(new Error('saveAllMessage: onerror fired'));
};
});
});

View file

@ -37474,7 +37474,7 @@ var TextSecureServer = (function() {
url = options.host + '/' + options.path;
}
console.log(options.type, url);
var timeout = typeof options.timeout !== 'undefined' ? options.timeout : 5000;
var timeout = typeof options.timeout !== 'undefined' ? options.timeout : 10000;
var fetchOptions = {
method: options.type,