Merge tag 'v1.17.2-beta.1'

pull/40/head^2
Scott Nonnenberg 7 years ago
commit c29afb6c97

@ -131,7 +131,10 @@
deleteAttachmentData, deleteAttachmentData,
getCurrentVersion, getCurrentVersion,
} = window.Signal.Migrations; } = window.Signal.Migrations;
const { Migrations0DatabaseWithAttachmentData } = window.Signal.Migrations; const {
Migrations0DatabaseWithAttachmentData,
Migrations1DatabaseWithoutAttachmentData,
} = window.Signal.Migrations;
const { Views } = window.Signal; const { Views } = window.Signal;
// Implicitly used in `indexeddb-backbonejs-adapter`: // Implicitly used in `indexeddb-backbonejs-adapter`:
@ -388,6 +391,23 @@
Views.Initialization.setMessage(window.i18n('optimizingApplication')); Views.Initialization.setMessage(window.i18n('optimizingApplication'));
window.log.info('Running cleanup IndexedDB migrations...');
// Close all previous connections to the database first
await Whisper.Database.close();
// Now we clean up IndexedDB database after extracting data from it
await Migrations1DatabaseWithoutAttachmentData.run({
Backbone,
logger: window.log,
});
await Whisper.Database.close();
const latestDBVersion = _.last(
Migrations1DatabaseWithoutAttachmentData.migrations
).version;
Whisper.Database.migrations[0].version = latestDBVersion;
window.log.info('Cleanup: starting...'); window.log.info('Cleanup: starting...');
const messagesForCleanup = await window.Signal.Data.getOutgoingWithoutExpiresAt( const messagesForCleanup = await window.Signal.Data.getOutgoingWithoutExpiresAt(
{ {
@ -727,6 +747,7 @@
// (but only if we're not the primary device) // (but only if we're not the primary device)
if ( if (
!firstRun && !firstRun &&
connectCount === 1 &&
newVersion && newVersion &&
// eslint-disable-next-line eqeqeq // eslint-disable-next-line eqeqeq
textsecure.storage.user.getDeviceId() != '1' textsecure.storage.user.getDeviceId() != '1'

@ -346,11 +346,6 @@ async function importFromJsonString(db, jsonString, targetPath, options) {
_.each(remainingStoreNames, storeName => { _.each(remainingStoreNames, storeName => {
window.log.info('Importing items for store', storeName); window.log.info('Importing items for store', storeName);
if (!importObject[storeName].length) {
delete importObject[storeName];
return;
}
let count = 0; let count = 0;
let skipCount = 0; let skipCount = 0;
@ -372,6 +367,10 @@ async function importFromJsonString(db, jsonString, targetPath, options) {
} }
}; };
if (!importObject[storeName].length) {
finishStore();
}
_.each(importObject[storeName], toAdd => { _.each(importObject[storeName], toAdd => {
toAdd = unstringify(toAdd); toAdd = unstringify(toAdd);
@ -402,7 +401,7 @@ async function importFromJsonString(db, jsonString, targetPath, options) {
// We have to check here, because we may have skipped every item, resulting // We have to check here, because we may have skipped every item, resulting
// in no onsuccess callback at all. // in no onsuccess callback at all.
if (count === importObject[storeName].length) { if (skipCount === count) {
finishStore(); finishStore();
} }
}); });

@ -1,25 +1,37 @@
/* global window */ /* global window */
const { last } = require('lodash'); const { last, includes } = require('lodash');
const db = require('../database'); const { open } = require('../database');
const settings = require('../settings'); const settings = require('../settings');
const { runMigrations } = require('./run_migrations'); const { runMigrations } = require('./run_migrations');
// These are migrations for after the SQLCipher migration, currently not running // These are cleanup migrations, to be run after migration to SQLCipher
exports.migrations = [ exports.migrations = [
{ {
version: 20, version: 20,
migrate(transaction, next) { migrate(transaction, next) {
window.log.info('Migration 20'); window.log.info('Migration 20');
window.log.info(
'Removing messages, unprocessed, and conversations object stores' const { db } = transaction;
);
// This should be run after things are migrated to SQLCipher // This should be run after things are migrated to SQLCipher
transaction.db.deleteObjectStore('messages');
transaction.db.deleteObjectStore('unprocessed'); // We check for existence first, because this removal was present in v1.17.0.beta.1,
transaction.db.deleteObjectStore('conversations'); // but reverted in v1.17.0-beta.3
if (includes(db.objectStoreNames, 'messages')) {
window.log.info('Removing messages store');
db.deleteObjectStore('messages');
}
if (includes(db.objectStoreNames, 'unprocessed')) {
window.log.info('Removing unprocessed store');
db.deleteObjectStore('unprocessed');
}
if (includes(db.objectStoreNames, 'conversations')) {
window.log.info('Removing conversations store');
db.deleteObjectStore('conversations');
}
next(); next();
}, },
@ -48,7 +60,7 @@ exports.run = async ({ Backbone, logger } = {}) => {
}; };
exports.getStatus = async ({ database } = {}) => { exports.getStatus = async ({ database } = {}) => {
const connection = await db.open(database.id, database.version); const connection = await open(database.id, database.version);
const isAttachmentMigrationComplete = await settings.isAttachmentMigrationComplete( const isAttachmentMigrationComplete = await settings.isAttachmentMigrationComplete(
connection connection
); );

@ -3,7 +3,7 @@
"productName": "Signal", "productName": "Signal",
"description": "Private messaging from your desktop", "description": "Private messaging from your desktop",
"repository": "https://github.com/signalapp/Signal-Desktop.git", "repository": "https://github.com/signalapp/Signal-Desktop.git",
"version": "1.17.1", "version": "1.17.2-beta.1",
"license": "GPL-3.0", "license": "GPL-3.0",
"author": { "author": {
"name": "Open Whisper Systems", "name": "Open Whisper Systems",

@ -164,7 +164,7 @@
"rule": "jQuery-$(", "rule": "jQuery-$(",
"path": "js/background.js", "path": "js/background.js",
"line": " if ($('.dark-overlay').length) {", "line": " if ($('.dark-overlay').length) {",
"lineNumber": 261, "lineNumber": 264,
"reasonCategory": "usageTrusted", "reasonCategory": "usageTrusted",
"updated": "2018-09-19T21:59:32.770Z", "updated": "2018-09-19T21:59:32.770Z",
"reasonDetail": "Protected from arbitrary input" "reasonDetail": "Protected from arbitrary input"
@ -173,7 +173,7 @@
"rule": "jQuery-$(", "rule": "jQuery-$(",
"path": "js/background.js", "path": "js/background.js",
"line": " $(document.body).prepend('<div class=\"dark-overlay\"></div>');", "line": " $(document.body).prepend('<div class=\"dark-overlay\"></div>');",
"lineNumber": 264, "lineNumber": 267,
"reasonCategory": "usageTrusted", "reasonCategory": "usageTrusted",
"updated": "2018-09-19T21:59:32.770Z", "updated": "2018-09-19T21:59:32.770Z",
"reasonDetail": "Protected from arbitrary input" "reasonDetail": "Protected from arbitrary input"
@ -182,7 +182,7 @@
"rule": "jQuery-prepend(", "rule": "jQuery-prepend(",
"path": "js/background.js", "path": "js/background.js",
"line": " $(document.body).prepend('<div class=\"dark-overlay\"></div>');", "line": " $(document.body).prepend('<div class=\"dark-overlay\"></div>');",
"lineNumber": 264, "lineNumber": 267,
"reasonCategory": "usageTrusted", "reasonCategory": "usageTrusted",
"updated": "2018-09-19T18:13:29.628Z", "updated": "2018-09-19T18:13:29.628Z",
"reasonDetail": "Hard-coded value" "reasonDetail": "Hard-coded value"
@ -191,7 +191,7 @@
"rule": "jQuery-$(", "rule": "jQuery-$(",
"path": "js/background.js", "path": "js/background.js",
"line": " $('.dark-overlay').on('click', () => $('.dark-overlay').remove());", "line": " $('.dark-overlay').on('click', () => $('.dark-overlay').remove());",
"lineNumber": 265, "lineNumber": 268,
"reasonCategory": "usageTrusted", "reasonCategory": "usageTrusted",
"updated": "2018-09-19T21:59:32.770Z", "updated": "2018-09-19T21:59:32.770Z",
"reasonDetail": "Protected from arbitrary input" "reasonDetail": "Protected from arbitrary input"
@ -200,7 +200,7 @@
"rule": "jQuery-$(", "rule": "jQuery-$(",
"path": "js/background.js", "path": "js/background.js",
"line": " removeDarkOverlay: () => $('.dark-overlay').remove(),", "line": " removeDarkOverlay: () => $('.dark-overlay').remove(),",
"lineNumber": 267, "lineNumber": 270,
"reasonCategory": "usageTrusted", "reasonCategory": "usageTrusted",
"updated": "2018-09-19T21:59:32.770Z", "updated": "2018-09-19T21:59:32.770Z",
"reasonDetail": "Protected from arbitrary input" "reasonDetail": "Protected from arbitrary input"
@ -209,7 +209,7 @@
"rule": "jQuery-$(", "rule": "jQuery-$(",
"path": "js/background.js", "path": "js/background.js",
"line": " $('body').append(clearDataView.el);", "line": " $('body').append(clearDataView.el);",
"lineNumber": 270, "lineNumber": 273,
"reasonCategory": "usageTrusted", "reasonCategory": "usageTrusted",
"updated": "2018-09-19T21:59:32.770Z", "updated": "2018-09-19T21:59:32.770Z",
"reasonDetail": "Protected from arbitrary input" "reasonDetail": "Protected from arbitrary input"
@ -218,7 +218,7 @@
"rule": "jQuery-append(", "rule": "jQuery-append(",
"path": "js/background.js", "path": "js/background.js",
"line": " $('body').append(clearDataView.el);", "line": " $('body').append(clearDataView.el);",
"lineNumber": 270, "lineNumber": 273,
"reasonCategory": "usageTrusted", "reasonCategory": "usageTrusted",
"updated": "2018-09-19T18:13:29.628Z", "updated": "2018-09-19T18:13:29.628Z",
"reasonDetail": "Interacting with already-existing DOM nodes" "reasonDetail": "Interacting with already-existing DOM nodes"
@ -227,7 +227,7 @@
"rule": "jQuery-load(", "rule": "jQuery-load(",
"path": "js/background.js", "path": "js/background.js",
"line": " await ConversationController.load();", "line": " await ConversationController.load();",
"lineNumber": 488, "lineNumber": 508,
"reasonCategory": "falseMatch", "reasonCategory": "falseMatch",
"updated": "2018-10-02T21:00:44.007Z" "updated": "2018-10-02T21:00:44.007Z"
}, },
@ -235,7 +235,7 @@
"rule": "jQuery-$(", "rule": "jQuery-$(",
"path": "js/background.js", "path": "js/background.js",
"line": " el: $('body'),", "line": " el: $('body'),",
"lineNumber": 542, "lineNumber": 562,
"reasonCategory": "usageTrusted", "reasonCategory": "usageTrusted",
"updated": "2018-09-19T21:59:32.770Z", "updated": "2018-09-19T21:59:32.770Z",
"reasonDetail": "Protected from arbitrary input" "reasonDetail": "Protected from arbitrary input"
@ -244,7 +244,7 @@
"rule": "jQuery-wrap(", "rule": "jQuery-wrap(",
"path": "js/background.js", "path": "js/background.js",
"line": " const profileKey = dcodeIO.ByteBuffer.wrap(details.profileKey).toString(", "line": " const profileKey = dcodeIO.ByteBuffer.wrap(details.profileKey).toString(",
"lineNumber": 863, "lineNumber": 884,
"reasonCategory": "falseMatch", "reasonCategory": "falseMatch",
"updated": "2018-10-02T21:00:44.007Z" "updated": "2018-10-02T21:00:44.007Z"
}, },

Loading…
Cancel
Save