Merge tag 'v1.17.2-beta.1'

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

@ -131,7 +131,10 @@
deleteAttachmentData,
getCurrentVersion,
} = window.Signal.Migrations;
const { Migrations0DatabaseWithAttachmentData } = window.Signal.Migrations;
const {
Migrations0DatabaseWithAttachmentData,
Migrations1DatabaseWithoutAttachmentData,
} = window.Signal.Migrations;
const { Views } = window.Signal;
// Implicitly used in `indexeddb-backbonejs-adapter`:
@ -388,6 +391,23 @@
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...');
const messagesForCleanup = await window.Signal.Data.getOutgoingWithoutExpiresAt(
{
@ -727,6 +747,7 @@
// (but only if we're not the primary device)
if (
!firstRun &&
connectCount === 1 &&
newVersion &&
// eslint-disable-next-line eqeqeq
textsecure.storage.user.getDeviceId() != '1'

@ -346,11 +346,6 @@ async function importFromJsonString(db, jsonString, targetPath, options) {
_.each(remainingStoreNames, storeName => {
window.log.info('Importing items for store', storeName);
if (!importObject[storeName].length) {
delete importObject[storeName];
return;
}
let count = 0;
let skipCount = 0;
@ -372,6 +367,10 @@ async function importFromJsonString(db, jsonString, targetPath, options) {
}
};
if (!importObject[storeName].length) {
finishStore();
}
_.each(importObject[storeName], 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
// in no onsuccess callback at all.
if (count === importObject[storeName].length) {
if (skipCount === count) {
finishStore();
}
});

@ -1,25 +1,37 @@
/* global window */
const { last } = require('lodash');
const { last, includes } = require('lodash');
const db = require('../database');
const { open } = require('../database');
const settings = require('../settings');
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 = [
{
version: 20,
migrate(transaction, next) {
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
transaction.db.deleteObjectStore('messages');
transaction.db.deleteObjectStore('unprocessed');
transaction.db.deleteObjectStore('conversations');
// We check for existence first, because this removal was present in v1.17.0.beta.1,
// 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();
},
@ -48,7 +60,7 @@ exports.run = async ({ Backbone, logger } = {}) => {
};
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(
connection
);

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

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

Loading…
Cancel
Save