|
|
|
|
@ -131,10 +131,7 @@
|
|
|
|
|
deleteAttachmentData,
|
|
|
|
|
getCurrentVersion,
|
|
|
|
|
} = window.Signal.Migrations;
|
|
|
|
|
const {
|
|
|
|
|
Migrations0DatabaseWithAttachmentData,
|
|
|
|
|
Migrations1DatabaseWithoutAttachmentData,
|
|
|
|
|
} = window.Signal.Migrations;
|
|
|
|
|
const { Migrations0DatabaseWithAttachmentData } = window.Signal.Migrations;
|
|
|
|
|
const { Views } = window.Signal;
|
|
|
|
|
|
|
|
|
|
// Implicitly used in `indexeddb-backbonejs-adapter`:
|
|
|
|
|
@ -391,20 +388,6 @@
|
|
|
|
|
|
|
|
|
|
Views.Initialization.setMessage(window.i18n('optimizingApplication'));
|
|
|
|
|
|
|
|
|
|
window.log.info('Running cleanup IndexedDB migrations...');
|
|
|
|
|
await Whisper.Database.close();
|
|
|
|
|
|
|
|
|
|
// Now we clean up IndexedDB database after extracting data from it
|
|
|
|
|
await Migrations1DatabaseWithoutAttachmentData.run({
|
|
|
|
|
Backbone,
|
|
|
|
|
logger: window.log,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const latestDBVersion = _.last(
|
|
|
|
|
Migrations1DatabaseWithoutAttachmentData.migrations
|
|
|
|
|
).version;
|
|
|
|
|
Whisper.Database.migrations[0].version = latestDBVersion;
|
|
|
|
|
|
|
|
|
|
window.log.info('Cleanup: starting...');
|
|
|
|
|
const messagesForCleanup = await window.Signal.Data.getOutgoingWithoutExpiresAt(
|
|
|
|
|
{
|
|
|
|
|
@ -452,9 +435,6 @@
|
|
|
|
|
|
|
|
|
|
Views.Initialization.setMessage(window.i18n('loading'));
|
|
|
|
|
|
|
|
|
|
// Note: We are not invoking the second set of IndexedDB migrations because it is
|
|
|
|
|
// likely that any future migrations will simply extracting things from IndexedDB.
|
|
|
|
|
|
|
|
|
|
idleDetector = new IdleDetector();
|
|
|
|
|
let isMigrationWithIndexComplete = false;
|
|
|
|
|
window.log.info(
|
|
|
|
|
|