Migrate to SQLCipher for messages/cache

Quite a few other fixes, including:
  - Sending to contact with no avatar yet (not synced from mobile)
  - Left pane doesn't update quickly or at all on new message
  - Left pane doesn't show sent or error status

Also:
 - Contributing.md: Ensure set of linux dev dependencies is complete
This commit is contained in:
Scott Nonnenberg 2018-07-26 18:13:56 -07:00
parent fc461c82ce
commit 3105b77475
29 changed files with 2006 additions and 716 deletions

View file

@ -71,6 +71,7 @@ function deleteDatabase() {
/* Delete the database before running any tests */
before(async () => {
await deleteDatabase();
await window.Signal.Data.removeAll();
await Signal.Migrations.Migrations0DatabaseWithAttachmentData.run({
Backbone,
@ -82,4 +83,5 @@ before(async () => {
async function clearDatabase() {
const db = await Whisper.Database.open();
await Whisper.Database.clear();
await window.Signal.Data.removeAll();
}

View file

@ -34,12 +34,11 @@ describe('KeyChangeListener', function() {
});
it('generates a key change notice in the private conversation with this contact', function(done) {
convo.on('newmessage', function() {
return convo.fetchMessages().then(function() {
var message = convo.messageCollection.at(0);
assert.strictEqual(message.get('type'), 'keychange');
done();
});
convo.on('newmessage', async function() {
await convo.fetchMessages();
var message = convo.messageCollection.at(0);
assert.strictEqual(message.get('type'), 'keychange');
done();
});
store.saveIdentity(address.toString(), newKey);
});
@ -61,12 +60,11 @@ describe('KeyChangeListener', function() {
});
it('generates a key change notice in the group conversation with this contact', function(done) {
convo.on('newmessage', function() {
return convo.fetchMessages().then(function() {
var message = convo.messageCollection.at(0);
assert.strictEqual(message.get('type'), 'keychange');
done();
});
convo.on('newmessage', async function() {
await convo.fetchMessages();
var message = convo.messageCollection.at(0);
assert.strictEqual(message.get('type'), 'keychange');
done();
});
store.saveIdentity(address.toString(), newKey);
});