Improve our deletion of IndexedDB post-SQLCipher migration

This commit is contained in:
Scott Nonnenberg 2018-11-12 14:13:16 -08:00
parent 6300256a3e
commit ecf3f18762
2 changed files with 23 additions and 1 deletions

View file

@ -301,10 +301,18 @@
await mandatoryMessageUpgrade({ upgradeMessageSchema });
await migrateAllToSQLCipher({ writeNewAttachmentData, Views });
await removeDatabase();
await window.Signal.Data.removeIndexedDBFiles();
try {
await window.Signal.Data.removeIndexedDBFiles();
} catch (error) {
window.log.error(
'Failed to remove IndexedDB files:',
error && error.stack ? error.stack : error
);
}
window.installStorage(window.newStorage);
await window.storage.fetch();
await storage.put('indexeddb-delete-needed', true);
}
Views.Initialization.setMessage(window.i18n('optimizingApplication'));