1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-08-13 22:12:50 +02:00

More sync checks

This commit is contained in:
Laurent Cozic
2017-07-02 11:34:07 +01:00
parent 71ae18c254
commit d56fb48299
14 changed files with 123 additions and 1292 deletions

View File

@@ -9,3 +9,4 @@ tests/fuzzing/client0
tests/fuzzing/client1 tests/fuzzing/client1
tests/fuzzing/client2 tests/fuzzing/client2
tests/fuzzing/sync tests/fuzzing/sync
tests/fuzzing.*

File diff suppressed because one or more lines are too long

View File

@@ -107,22 +107,27 @@ commands.push({
}); });
commands.push({ commands.push({
usage: 'set <item-title> <prop-name> [prop-value]', usage: 'set <title> <name> [value]',
description: 'Sets the given <prop-name> of the given item.', description: 'Sets the property <name> of the given item to the given [value].',
action: function(args, end) { action: async function(args, end) {
try {
let promise = null; let promise = null;
let title = args['item-title']; let title = args['title'];
let propName = args['prop-name']; let propName = args['name'];
let propValue = args['prop-value']; let propValue = args['value'];
if (!propValue) propValue = ''; if (!propValue) propValue = '';
let item = null;
if (!currentFolder) { if (!currentFolder) {
promise = Folder.loadByField('title', title); item = await Folder.loadByField('title', title);
} else { } else {
promise = Note.loadFolderNoteByField(currentFolder.id, 'title', title); item = await Note.loadFolderNoteByField(currentFolder.id, 'title', title);
}
if (!item) {
item = await BaseItem.loadItemById(title);
} }
promise.then((item) => {
if (!item) { if (!item) {
this.log(_('No item with title "%s" found.', title)); this.log(_('No item with title "%s" found.', title));
end(); end();
@@ -135,21 +140,20 @@ commands.push({
}; };
newItem[propName] = propValue; newItem[propName] = propValue;
let ItemClass = BaseItem.itemClass(newItem); let ItemClass = BaseItem.itemClass(newItem);
return ItemClass.save(newItem); await ItemClass.save(newItem);
}).catch((error) => { } catch(error) {
this.log(error); this.log(error);
}).then(() => { }
end(); end();
});
}, },
autocomplete: autocompleteItems, autocomplete: autocompleteItems,
}); });
commands.push({ commands.push({
usage: 'cat <item-title>', usage: 'cat <title>',
description: 'Displays the given item data.', description: 'Displays the given item data.',
action: function(args, end) { action: function(args, end) {
let title = args['item-title']; let title = args['title'];
let promise = null; let promise = null;
if (!currentFolder) { if (!currentFolder) {
@@ -369,6 +373,9 @@ commands.push({
commands.push({ commands.push({
usage: 'sync', usage: 'sync',
description: 'Synchronizes with remote storage.', description: 'Synchronizes with remote storage.',
options: [
['--random-failures', 'For debugging purposes. Do not use.'],
],
action: function(args, end) { action: function(args, end) {
let redrawnCalled = false; let redrawnCalled = false;
@@ -380,13 +387,14 @@ commands.push({
if (report.remotesToDelete) line.push(_('Remote items to delete: %d/%d.', report.deleteRemote, report.remotesToDelete)); if (report.remotesToDelete) line.push(_('Remote items to delete: %d/%d.', report.deleteRemote, report.remotesToDelete));
if (report.localsToUdpate) line.push(_('Items to download: %d/%d.', report.createLocal + report.updateLocal, report.localsToUdpate)); if (report.localsToUdpate) line.push(_('Items to download: %d/%d.', report.createLocal + report.updateLocal, report.localsToUdpate));
if (report.localsToDelete) line.push(_('Local items to delete: %d/%d.', report.deleteLocal, report.localsToDelete)); if (report.localsToDelete) line.push(_('Local items to delete: %d/%d.', report.deleteLocal, report.localsToDelete));
redrawnCalled = true; //redrawnCalled = true;
vorpal.ui.redraw(line.join(' ')); //vorpal.ui.redraw(line.join(' '));
}, },
onMessage: (msg) => { onMessage: (msg) => {
if (redrawnCalled) vorpal.ui.redraw.done(); if (redrawnCalled) vorpal.ui.redraw.done();
this.log(msg); this.log(msg);
}, },
randomFailures: args.options['random-failures'] === true,
}; };
this.log(_('Synchronization target: %s', Setting.value('sync.target'))); this.log(_('Synchronization target: %s', Setting.value('sync.target')));
@@ -766,8 +774,6 @@ async function main() {
o.action(c.action); o.action(c.action);
} }
vorpal.history(Setting.value('appId')); // Enables persistent history
let argv = process.argv; let argv = process.argv;
argv = await handleStartFlags(argv); argv = await handleStartFlags(argv);
@@ -802,7 +808,6 @@ async function main() {
let activeFolder = null; let activeFolder = null;
if (activeFolderId) activeFolder = await Folder.load(activeFolderId); if (activeFolderId) activeFolder = await Folder.load(activeFolderId);
if (!activeFolder) activeFolder = await Folder.defaultFolder(); if (!activeFolder) activeFolder = await Folder.defaultFolder();
//if (!activeFolder) throw new Error(_('No default notebook is defined and could not create a new one. The database might be corrupted, please delete it and try again.'));
Setting.setValue('activeFolderId', activeFolder ? activeFolder.id : ''); Setting.setValue('activeFolderId', activeFolder ? activeFolder.id : '');
if (activeFolder) await execCommand('cd', { 'notebook': activeFolder.title }); // Use execCommand() so that no history entry is created if (activeFolder) await execCommand('cd', { 'notebook': activeFolder.title }); // Use execCommand() so that no history entry is created
@@ -814,6 +819,7 @@ async function main() {
await vorpal.exec('exit'); await vorpal.exec('exit');
return; return;
} else { } else {
vorpal.history(Setting.value('appId')); // Enables persistent history
vorpal.delimiter(promptString()).show(); vorpal.delimiter(promptString()).show();
if (!activeFolder) { if (!activeFolder) {
vorpal.log(_('No notebook is defined. Create one with `mkbook <notebook>`.')); vorpal.log(_('No notebook is defined. Create one with `mkbook <notebook>`.'));

View File

@@ -1,470 +0,0 @@
2017-07-01 13:09:29: Database was open successfully
2017-07-01 13:09:29: Checking for database schema update...
2017-07-01 13:09:29: SELECT * FROM version LIMIT 1
2017-07-01 13:09:29: Database is new - creating the schema...
2017-07-01 13:09:29: BEGIN TRANSACTION
2017-07-01 13:09:29: CREATE TABLE folders ( id TEXT PRIMARY KEY, parent_id TEXT NOT NULL DEFAULT "", title TEXT NOT NULL DEFAULT "", created_time INT NOT NULL DEFAULT 0, updated_time INT NOT NULL DEFAULT 0, sync_time INT NOT NULL DEFAULT 0);
2017-07-01 13:09:29: CREATE INDEX folders_title ON folders (title);
2017-07-01 13:09:29: CREATE INDEX folders_updated_time ON folders (updated_time);
2017-07-01 13:09:29: CREATE INDEX folders_sync_time ON folders (sync_time);
2017-07-01 13:09:29: CREATE TABLE notes ( id TEXT PRIMARY KEY, parent_id TEXT NOT NULL DEFAULT "", title TEXT NOT NULL DEFAULT "", body TEXT NOT NULL DEFAULT "", created_time INT NOT NULL DEFAULT 0, updated_time INT NOT NULL DEFAULT 0, sync_time INT NOT NULL DEFAULT 0, is_conflict INT NOT NULL DEFAULT 0, latitude NUMERIC NOT NULL DEFAULT 0, longitude NUMERIC NOT NULL DEFAULT 0, altitude NUMERIC NOT NULL DEFAULT 0, author TEXT NOT NULL DEFAULT "", source_url TEXT NOT NULL DEFAULT "", is_todo INT NOT NULL DEFAULT 0, todo_due INT NOT NULL DEFAULT 0, todo_completed INT NOT NULL DEFAULT 0, source TEXT NOT NULL DEFAULT "", source_application TEXT NOT NULL DEFAULT "", application_data TEXT NOT NULL DEFAULT "", `order` INT NOT NULL DEFAULT 0);
2017-07-01 13:09:29: CREATE INDEX notes_title ON notes (title);
2017-07-01 13:09:29: CREATE INDEX notes_updated_time ON notes (updated_time);
2017-07-01 13:09:29: CREATE INDEX notes_sync_time ON notes (sync_time);
2017-07-01 13:09:29: CREATE INDEX notes_is_conflict ON notes (is_conflict);
2017-07-01 13:09:29: CREATE INDEX notes_is_todo ON notes (is_todo);
2017-07-01 13:09:29: CREATE INDEX notes_order ON notes (`order`);
2017-07-01 13:09:29: CREATE TABLE deleted_items ( id INTEGER PRIMARY KEY, item_type INT NOT NULL, item_id TEXT NOT NULL, deleted_time INT NOT NULL);
2017-07-01 13:09:29: CREATE TABLE tags ( id TEXT PRIMARY KEY, title TEXT, created_time INT, updated_time INT);
2017-07-01 13:09:29: CREATE TABLE note_tags ( id INTEGER PRIMARY KEY, note_id TEXT, tag_id TEXT);
2017-07-01 13:09:29: CREATE TABLE resources ( id TEXT PRIMARY KEY, title TEXT, mime TEXT, filename TEXT, created_time INT, updated_time INT);
2017-07-01 13:09:29: CREATE TABLE note_resources ( id INTEGER PRIMARY KEY, note_id TEXT, resource_id TEXT);
2017-07-01 13:09:29: CREATE TABLE version ( version INT);
2017-07-01 13:09:29: CREATE TABLE changes ( id INTEGER PRIMARY KEY, `type` INT, item_id TEXT, item_type INT, item_field TEXT);
2017-07-01 13:09:29: CREATE TABLE settings ( `key` TEXT PRIMARY KEY, `value` TEXT, `type` INT);
2017-07-01 13:09:29: CREATE TABLE table_fields ( id INTEGER PRIMARY KEY, table_name TEXT, field_name TEXT, field_type INT, field_default TEXT);
2017-07-01 13:09:29: CREATE TABLE item_sync_times ( id INTEGER PRIMARY KEY, item_id TEXT, `time` INT);
2017-07-01 13:09:29: INSERT INTO version (version) VALUES (1);
2017-07-01 13:09:29: INSERT INTO settings (`key`, `value`, `type`) VALUES ("clientId", "5d327ad5ac5546ad9826dd8f1d754e52", "2")
2017-07-01 13:09:29: INSERT INTO `folders` (`id`, `title`, `created_time`, `updated_time`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:29: ["68cba53569c84bfbad79eee85402160b","Notebook",1498910969401,1498910969401]
2017-07-01 13:09:29: COMMIT
2017-07-01 13:09:29: Database schema created successfully
2017-07-01 13:09:29: Initializing tables...
2017-07-01 13:09:29: SELECT name FROM sqlite_master WHERE type="table"
2017-07-01 13:09:29: PRAGMA table_info("folders")
2017-07-01 13:09:29: PRAGMA table_info("notes")
2017-07-01 13:09:29: PRAGMA table_info("deleted_items")
2017-07-01 13:09:29: PRAGMA table_info("tags")
2017-07-01 13:09:29: PRAGMA table_info("note_tags")
2017-07-01 13:09:29: PRAGMA table_info("resources")
2017-07-01 13:09:29: PRAGMA table_info("note_resources")
2017-07-01 13:09:29: PRAGMA table_info("version")
2017-07-01 13:09:29: PRAGMA table_info("changes")
2017-07-01 13:09:29: PRAGMA table_info("settings")
2017-07-01 13:09:29: PRAGMA table_info("item_sync_times")
2017-07-01 13:09:29: BEGIN TRANSACTION
2017-07-01 13:09:29: DELETE FROM table_fields
2017-07-01 13:09:29: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:29: ["folders","id",2,null]
2017-07-01 13:09:29: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:29: ["folders","parent_id",2,""]
2017-07-01 13:09:29: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:29: ["folders","title",2,""]
2017-07-01 13:09:29: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:29: ["folders","created_time",1,"0"]
2017-07-01 13:09:29: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:29: ["folders","updated_time",1,"0"]
2017-07-01 13:09:29: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["folders","sync_time",1,"0"]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["notes","id",2,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["notes","parent_id",2,""]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["notes","title",2,""]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["notes","body",2,""]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["notes","created_time",1,"0"]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["notes","updated_time",1,"0"]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["notes","sync_time",1,"0"]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["notes","is_conflict",1,"0"]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["notes","latitude",3,"0"]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["notes","longitude",3,"0"]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["notes","altitude",3,"0"]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["notes","author",2,""]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["notes","source_url",2,""]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["notes","is_todo",1,"0"]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["notes","todo_due",1,"0"]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["notes","todo_completed",1,"0"]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["notes","source",2,""]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["notes","source_application",2,""]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["notes","application_data",2,""]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["notes","order",1,"0"]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["deleted_items","id",null,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["deleted_items","item_type",1,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["deleted_items","item_id",2,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["deleted_items","deleted_time",1,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["tags","id",2,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["tags","title",2,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["tags","created_time",1,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["tags","updated_time",1,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["note_tags","id",null,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["note_tags","note_id",2,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["note_tags","tag_id",2,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["resources","id",2,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["resources","title",2,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["resources","mime",2,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["resources","filename",2,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["resources","created_time",1,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["resources","updated_time",1,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["note_resources","id",null,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["note_resources","note_id",2,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["note_resources","resource_id",2,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["version","version",1,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["changes","id",null,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["changes","type",1,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["changes","item_id",2,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["changes","item_type",1,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["changes","item_field",2,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["settings","key",2,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["settings","value",2,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["settings","type",1,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["item_sync_times","id",null,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["item_sync_times","item_id",2,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["item_sync_times","time",1,null]
2017-07-01 13:09:30: COMMIT
2017-07-01 13:09:30: Checking for database schema update...
2017-07-01 13:09:30: SELECT * FROM version LIMIT 1
2017-07-01 13:09:30: Current database version
2017-07-01 13:09:30: SELECT * FROM table_fields
2017-07-01 13:09:30: SELECT * FROM settings
2017-07-01 13:09:30: SELECT * FROM folders ORDER BY created_time DESC LIMIT 1
2017-07-01 13:09:30: SELECT * FROM `folders` WHERE `title` = ?
2017-07-01 13:09:30: ["Notebook"]
2017-07-01 13:09:30: Saving settings...
2017-07-01 13:09:30: BEGIN TRANSACTION
2017-07-01 13:09:30: DELETE FROM settings
2017-07-01 13:09:30: INSERT INTO `settings` (`key`, `value`, `type`) VALUES (?, ?, ?)
2017-07-01 13:09:30: ["clientId","5d327ad5ac5546ad9826dd8f1d754e52",2]
2017-07-01 13:09:30: INSERT INTO `settings` (`value`, `type`, `key`) VALUES (?, ?, ?)
2017-07-01 13:09:30: ["68cba53569c84bfbad79eee85402160b","string","activeFolderId"]
2017-07-01 13:09:30: INSERT INTO `settings` (`value`, `type`, `key`) VALUES (?, ?, ?)
2017-07-01 13:09:30: ["local","string","sync.target"]
2017-07-01 13:09:30: COMMIT
2017-07-01 13:09:30: Settings have been saved.
2017-07-01 13:09:31: Database was open successfully
2017-07-01 13:09:31: Checking for database schema update...
2017-07-01 13:09:32: SELECT * FROM version LIMIT 1
2017-07-01 13:09:32: Current database version
2017-07-01 13:09:32: SELECT * FROM table_fields
2017-07-01 13:09:32: SELECT * FROM settings
2017-07-01 13:09:32: SELECT * FROM `folders` WHERE `id` = ?
2017-07-01 13:09:32: ["68cba53569c84bfbad79eee85402160b"]
2017-07-01 13:09:32: SELECT * FROM `folders` WHERE `title` = ?
2017-07-01 13:09:32: ["Notebook"]
2017-07-01 13:09:32: Saving settings...
2017-07-01 13:09:32: BEGIN TRANSACTION
2017-07-01 13:09:32: DELETE FROM settings
2017-07-01 13:09:32: INSERT INTO `settings` (`key`, `value`, `type`) VALUES (?, ?, ?)
2017-07-01 13:09:32: ["clientId","5d327ad5ac5546ad9826dd8f1d754e52",2]
2017-07-01 13:09:32: INSERT INTO `settings` (`key`, `value`, `type`) VALUES (?, ?, ?)
2017-07-01 13:09:32: ["activeFolderId","68cba53569c84bfbad79eee85402160b","string"]
2017-07-01 13:09:32: INSERT INTO `settings` (`key`, `value`, `type`) VALUES (?, ?, ?)
2017-07-01 13:09:32: ["sync.target","local","string"]
2017-07-01 13:09:32: INSERT INTO `settings` (`value`, `type`, `key`) VALUES (?, ?, ?)
2017-07-01 13:09:32: ["/var/www/joplin/CliClient/tests/fuzzing/sync","string","sync.local.path"]
2017-07-01 13:09:32: COMMIT
2017-07-01 13:09:32: Settings have been saved.
2017-07-01 13:09:33: Database was open successfully
2017-07-01 13:09:33: Checking for database schema update...
2017-07-01 13:09:33: SELECT * FROM version LIMIT 1
2017-07-01 13:09:33: Current database version
2017-07-01 13:09:33: SELECT * FROM table_fields
2017-07-01 13:09:33: SELECT * FROM settings
2017-07-01 13:09:33: SELECT * FROM `folders` WHERE `id` = ?
2017-07-01 13:09:33: ["68cba53569c84bfbad79eee85402160b"]
2017-07-01 13:09:33: SELECT * FROM `folders` WHERE `title` = ?
2017-07-01 13:09:33: ["Notebook"]
2017-07-01 13:09:33: INSERT INTO `notes` (`parent_id`, `title`, `source`, `source_application`, `updated_time`, `id`, `created_time`) VALUES (?, ?, ?, ?, ?, ?, ?)
2017-07-01 13:09:33: ["68cba53569c84bfbad79eee85402160b","smash","joplin","net.cozic.joplin-cli",1498910973758,"351b927410b541e1a6d1a2a88ef7d1c0",1498910973758]
2017-07-01 13:09:34: SELECT * FROM `notes` WHERE `id` = ?
2017-07-01 13:09:34: ["351b927410b541e1a6d1a2a88ef7d1c0"]
2017-07-01 13:09:35: Database was open successfully
2017-07-01 13:09:35: Checking for database schema update...
2017-07-01 13:09:35: SELECT * FROM version LIMIT 1
2017-07-01 13:09:35: Current database version
2017-07-01 13:09:35: SELECT * FROM table_fields
2017-07-01 13:09:35: SELECT * FROM settings
2017-07-01 13:09:35: SELECT * FROM `folders` WHERE `id` = ?
2017-07-01 13:09:35: ["68cba53569c84bfbad79eee85402160b"]
2017-07-01 13:09:35: SELECT * FROM `folders` WHERE `title` = ?
2017-07-01 13:09:35: ["Notebook"]
2017-07-01 13:09:35: SELECT * FROM `folders`
2017-07-01 13:09:35: SELECT `id`,`title`,`body`,`is_todo`,`todo_completed`,`parent_id`,`updated_time` FROM notes WHERE is_conflict = 0 AND parent_id = ? ORDER BY updated_time DESC
2017-07-01 13:09:35: ["68cba53569c84bfbad79eee85402160b"]
2017-07-01 13:09:36: Database was open successfully
2017-07-01 13:09:36: Checking for database schema update...
2017-07-01 13:09:36: SELECT * FROM version LIMIT 1
2017-07-01 13:09:36: Current database version
2017-07-01 13:09:36: SELECT * FROM table_fields
2017-07-01 13:09:36: SELECT * FROM settings
2017-07-01 13:09:36: SELECT * FROM `folders` WHERE `id` = ?
2017-07-01 13:09:36: ["68cba53569c84bfbad79eee85402160b"]
2017-07-01 13:09:36: SELECT * FROM `folders` WHERE `title` = ?
2017-07-01 13:09:36: ["Notebook"]
2017-07-01 13:09:36: SELECT * FROM `notes` WHERE `title` = ?
2017-07-01 13:09:36: ["smash"]
2017-07-01 13:09:36: DELETE FROM notes WHERE id = ?
2017-07-01 13:09:36: ["351b927410b541e1a6d1a2a88ef7d1c0"]
2017-07-01 13:09:37: INSERT INTO deleted_items (item_type, item_id, deleted_time) VALUES (?, ?, ?)
2017-07-01 13:09:37: [1,"351b927410b541e1a6d1a2a88ef7d1c0",1498910977016]
2017-07-01 13:09:38: Database was open successfully
2017-07-01 13:09:38: Checking for database schema update...
2017-07-01 13:09:38: SELECT * FROM version LIMIT 1
2017-07-01 13:09:38: Current database version
2017-07-01 13:09:38: SELECT * FROM table_fields
2017-07-01 13:09:38: SELECT * FROM settings
2017-07-01 13:09:38: SELECT * FROM `folders` WHERE `id` = ?
2017-07-01 13:09:38: ["68cba53569c84bfbad79eee85402160b"]
2017-07-01 13:09:38: SELECT * FROM `folders` WHERE `title` = ?
2017-07-01 13:09:38: ["Notebook"]
2017-07-01 13:09:38: SELECT * FROM folders WHERE sync_time < updated_time LIMIT 100
2017-07-01 13:09:38: SELECT * FROM `folders` WHERE `title` = ?
2017-07-01 13:09:38: [null]
2017-07-01 13:09:38: UPDATE `folders` SET `sync_time`=? WHERE id=?
2017-07-01 13:09:38: [1498910978678,"68cba53569c84bfbad79eee85402160b"]
2017-07-01 13:09:38: SELECT * FROM folders WHERE sync_time < updated_time LIMIT 100
2017-07-01 13:09:38: SELECT * FROM notes WHERE sync_time < updated_time AND is_conflict = 0 LIMIT 100
2017-07-01 13:09:38: SELECT * FROM deleted_items
2017-07-01 13:09:38: DELETE FROM deleted_items WHERE item_id = ?
2017-07-01 13:09:38: ["351b927410b541e1a6d1a2a88ef7d1c0"]
2017-07-01 13:09:39: SELECT * FROM `notes` WHERE `id` = ?
2017-07-01 13:09:39: ["68cba53569c84bfbad79eee85402160b"]
2017-07-01 13:09:39: SELECT * FROM `folders` WHERE `id` = ?
2017-07-01 13:09:39: ["68cba53569c84bfbad79eee85402160b"]
2017-07-01 13:09:39: SELECT id FROM folders WHERE sync_time > 0
2017-07-01 13:09:39: SELECT id FROM notes WHERE is_conflict = 0 AND sync_time > 0
2017-07-01 13:09:39: SELECT count(*) as total FROM `folders`
2017-07-01 13:09:39: SELECT count(*) as total FROM `notes`
2017-07-01 13:09:42: Database was open successfully
2017-07-01 13:09:42: Checking for database schema update...
2017-07-01 13:09:42: SELECT * FROM version LIMIT 1
2017-07-01 13:09:42: Current database version
2017-07-01 13:09:42: SELECT * FROM table_fields
2017-07-01 13:09:42: SELECT * FROM settings
2017-07-01 13:09:42: SELECT * FROM `folders` WHERE `id` = ?
2017-07-01 13:09:42: ["68cba53569c84bfbad79eee85402160b"]
2017-07-01 13:09:42: SELECT * FROM `folders` WHERE `title` = ?
2017-07-01 13:09:42: ["Notebook"]
2017-07-01 13:09:42: SELECT * FROM folders WHERE sync_time < updated_time LIMIT 100
2017-07-01 13:09:42: SELECT * FROM notes WHERE sync_time < updated_time AND is_conflict = 0 LIMIT 100
2017-07-01 13:09:42: SELECT * FROM deleted_items
2017-07-01 13:09:42: SELECT * FROM `notes` WHERE `id` = ?
2017-07-01 13:09:42: ["68cba53569c84bfbad79eee85402160b"]
2017-07-01 13:09:42: SELECT * FROM `folders` WHERE `id` = ?
2017-07-01 13:09:42: ["68cba53569c84bfbad79eee85402160b"]
2017-07-01 13:09:42: SELECT * FROM `notes` WHERE `id` = ?
2017-07-01 13:09:42: ["7711fd1e399e4219ba8f5f9e9eeefb16"]
2017-07-01 13:09:42: SELECT * FROM `folders` WHERE `id` = ?
2017-07-01 13:09:42: ["7711fd1e399e4219ba8f5f9e9eeefb16"]
2017-07-01 13:09:42: SELECT * FROM `folders` WHERE `title` = ?
2017-07-01 13:09:42: ["Notebook"]
2017-07-01 13:09:42: SELECT * FROM `folders` WHERE `title` = ?
2017-07-01 13:09:42: ["Notebook-1498910969408-979"]
2017-07-01 13:09:42: INSERT INTO `folders` (`id`, `title`, `created_time`, `updated_time`, `sync_time`) VALUES (?, ?, ?, ?, ?)
2017-07-01 13:09:42: ["7711fd1e399e4219ba8f5f9e9eeefb16","Notebook-1498910969408-979","1498910969408",1498910982544,1498910982542]
2017-07-01 13:09:42: SELECT id FROM folders WHERE sync_time > 0
2017-07-01 13:09:42: SELECT id FROM notes WHERE is_conflict = 0 AND sync_time > 0
2017-07-01 13:09:42: SELECT count(*) as total FROM `folders`
2017-07-01 13:09:42: SELECT count(*) as total FROM `notes`
2017-07-01 13:09:45: Database was open successfully
2017-07-01 13:09:45: Checking for database schema update...
2017-07-01 13:09:45: SELECT * FROM version LIMIT 1
2017-07-01 13:09:45: Current database version
2017-07-01 13:09:45: SELECT * FROM table_fields
2017-07-01 13:09:45: SELECT * FROM settings
2017-07-01 13:09:45: SELECT * FROM `folders` WHERE `id` = ?
2017-07-01 13:09:45: ["68cba53569c84bfbad79eee85402160b"]
2017-07-01 13:09:45: SELECT * FROM `folders` WHERE `title` = ?
2017-07-01 13:09:45: ["Notebook"]
2017-07-01 13:09:45: SELECT * FROM folders WHERE sync_time < updated_time LIMIT 100
2017-07-01 13:09:45: SELECT * FROM `folders` WHERE `title` = ?
2017-07-01 13:09:45: [null]
2017-07-01 13:09:45: UPDATE `folders` SET `sync_time`=? WHERE id=?
2017-07-01 13:09:45: [1498910985838,"7711fd1e399e4219ba8f5f9e9eeefb16"]
2017-07-01 13:09:45: SELECT * FROM folders WHERE sync_time < updated_time LIMIT 100
2017-07-01 13:09:45: SELECT * FROM notes WHERE sync_time < updated_time AND is_conflict = 0 LIMIT 100
2017-07-01 13:09:46: SELECT * FROM deleted_items
2017-07-01 13:09:46: SELECT * FROM `notes` WHERE `id` = ?
2017-07-01 13:09:46: ["68cba53569c84bfbad79eee85402160b"]
2017-07-01 13:09:46: SELECT * FROM `folders` WHERE `id` = ?
2017-07-01 13:09:46: ["68cba53569c84bfbad79eee85402160b"]
2017-07-01 13:09:46: SELECT * FROM `folders` WHERE `title` = ?
2017-07-01 13:09:46: ["Notebook-1498910969401-461"]
2017-07-01 13:09:46: UPDATE `folders` SET `title`=?, `created_time`=?, `updated_time`=?, `sync_time`=? WHERE id=?
2017-07-01 13:09:46: ["Notebook-1498910969401-461","1498910969401","1498910980801",1498910986033,"68cba53569c84bfbad79eee85402160b"]
2017-07-01 13:09:46: SELECT * FROM `notes` WHERE `id` = ?
2017-07-01 13:09:46: ["7711fd1e399e4219ba8f5f9e9eeefb16"]
2017-07-01 13:09:46: SELECT * FROM `folders` WHERE `id` = ?
2017-07-01 13:09:46: ["7711fd1e399e4219ba8f5f9e9eeefb16"]
2017-07-01 13:09:46: SELECT id FROM folders WHERE sync_time > 0
2017-07-01 13:09:46: SELECT id FROM notes WHERE is_conflict = 0 AND sync_time > 0
2017-07-01 13:09:46: SELECT count(*) as total FROM `folders`
2017-07-01 13:09:46: SELECT count(*) as total FROM `notes`
2017-07-01 13:09:47: Database was open successfully
2017-07-01 13:09:47: Checking for database schema update...
2017-07-01 13:09:47: SELECT * FROM version LIMIT 1
2017-07-01 13:09:47: Current database version
2017-07-01 13:09:47: SELECT * FROM table_fields
2017-07-01 13:09:47: SELECT * FROM settings
2017-07-01 13:09:47: SELECT * FROM `folders` WHERE `id` = ?
2017-07-01 13:09:47: ["68cba53569c84bfbad79eee85402160b"]
2017-07-01 13:09:47: SELECT * FROM `folders` WHERE `title` = ?
2017-07-01 13:09:47: ["Notebook-1498910969401-461"]
2017-07-01 13:09:47: SELECT * FROM `folders`
2017-07-01 13:09:47: SELECT `id`,`title`,`body`,`is_todo`,`todo_completed`,`parent_id`,`updated_time` FROM notes WHERE is_conflict = 0 AND parent_id = ? ORDER BY updated_time DESC
2017-07-01 13:09:47: ["68cba53569c84bfbad79eee85402160b"]
2017-07-01 13:09:47: SELECT `id`,`title`,`body`,`is_todo`,`todo_completed`,`parent_id`,`updated_time` FROM notes WHERE is_conflict = 0 AND parent_id = ? ORDER BY updated_time DESC
2017-07-01 13:09:47: ["7711fd1e399e4219ba8f5f9e9eeefb16"]
2017-07-01 13:09:52: Database was open successfully
2017-07-01 13:09:52: Checking for database schema update...
2017-07-01 13:09:52: SELECT * FROM version LIMIT 1
2017-07-01 13:09:52: Current database version
2017-07-01 13:09:52: SELECT * FROM table_fields
2017-07-01 13:09:52: SELECT * FROM settings
2017-07-01 13:09:52: SELECT * FROM `folders` WHERE `id` = ?
2017-07-01 13:09:52: ["68cba53569c84bfbad79eee85402160b"]
2017-07-01 13:09:52: SELECT * FROM `folders` WHERE `title` = ?
2017-07-01 13:09:52: ["Notebook-1498910969401-461"]
2017-07-01 13:09:52: SELECT * FROM `folders`
2017-07-01 13:09:52: SELECT `id`,`title`,`body`,`is_todo`,`todo_completed`,`parent_id`,`updated_time` FROM notes WHERE is_conflict = 0 AND parent_id = ? ORDER BY updated_time DESC
2017-07-01 13:09:52: ["68cba53569c84bfbad79eee85402160b"]
2017-07-01 13:09:52: SELECT `id`,`title`,`body`,`is_todo`,`todo_completed`,`parent_id`,`updated_time` FROM notes WHERE is_conflict = 0 AND parent_id = ? ORDER BY updated_time DESC
2017-07-01 13:09:52: ["7711fd1e399e4219ba8f5f9e9eeefb16"]
2017-07-01 13:09:53: Database was open successfully
2017-07-01 13:09:53: Checking for database schema update...
2017-07-01 13:09:53: SELECT * FROM version LIMIT 1
2017-07-01 13:09:53: Current database version
2017-07-01 13:09:53: SELECT * FROM table_fields
2017-07-01 13:09:53: SELECT * FROM settings
2017-07-01 13:09:53: SELECT * FROM `folders` WHERE `id` = ?
2017-07-01 13:09:53: ["68cba53569c84bfbad79eee85402160b"]
2017-07-01 13:09:53: SELECT * FROM `folders` WHERE `title` = ?
2017-07-01 13:09:53: ["Notebook-1498910969401-461"]
2017-07-01 13:09:53: SELECT * FROM `folders` WHERE `title` = ?
2017-07-01 13:09:53: ["Notebook-1498910969401-461"]
2017-07-01 13:09:53: SELECT * FROM `folders` WHERE `id` = ?
2017-07-01 13:09:53: ["68cba53569c84bfbad79eee85402160b"]
2017-07-01 13:09:53: SELECT count(*) as total FROM `folders`
2017-07-01 13:09:53: SELECT id FROM notes WHERE is_conflict = 0 AND parent_id = ?
2017-07-01 13:09:53: ["68cba53569c84bfbad79eee85402160b"]
2017-07-01 13:09:53: DELETE FROM folders WHERE id = ?
2017-07-01 13:09:53: ["68cba53569c84bfbad79eee85402160b"]
2017-07-01 13:09:53: INSERT INTO deleted_items (item_type, item_id, deleted_time) VALUES (?, ?, ?)
2017-07-01 13:09:53: [2,"68cba53569c84bfbad79eee85402160b",1498910993916]
2017-07-01 13:09:54: SELECT * FROM folders ORDER BY created_time DESC LIMIT 1
2017-07-01 13:09:55: Database was open successfully
2017-07-01 13:09:55: Checking for database schema update...
2017-07-01 13:09:55: SELECT * FROM version LIMIT 1
2017-07-01 13:09:55: Current database version
2017-07-01 13:09:55: SELECT * FROM table_fields
2017-07-01 13:09:55: SELECT * FROM settings
2017-07-01 13:09:55: SELECT * FROM `folders` WHERE `id` = ?
2017-07-01 13:09:55: ["68cba53569c84bfbad79eee85402160b"]
2017-07-01 13:09:55: SELECT * FROM folders ORDER BY created_time DESC LIMIT 1
2017-07-01 13:09:55: SELECT * FROM `folders` WHERE `title` = ?
2017-07-01 13:09:55: ["Notebook-1498910969408-979"]
2017-07-01 13:09:55: SELECT * FROM folders WHERE sync_time < updated_time LIMIT 100
2017-07-01 13:09:55: SELECT * FROM notes WHERE sync_time < updated_time AND is_conflict = 0 LIMIT 100
2017-07-01 13:09:55: SELECT * FROM deleted_items
2017-07-01 13:09:55: DELETE FROM deleted_items WHERE item_id = ?
2017-07-01 13:09:55: ["68cba53569c84bfbad79eee85402160b"]
2017-07-01 13:09:55: SELECT * FROM `notes` WHERE `id` = ?
2017-07-01 13:09:55: ["7711fd1e399e4219ba8f5f9e9eeefb16"]
2017-07-01 13:09:55: SELECT * FROM `folders` WHERE `id` = ?
2017-07-01 13:09:55: ["7711fd1e399e4219ba8f5f9e9eeefb16"]
2017-07-01 13:09:55: SELECT id FROM folders WHERE sync_time > 0
2017-07-01 13:09:55: SELECT id FROM notes WHERE is_conflict = 0 AND sync_time > 0
2017-07-01 13:09:55: SELECT count(*) as total FROM `folders`
2017-07-01 13:09:55: SELECT count(*) as total FROM `notes`
2017-07-01 13:09:58: Database was open successfully
2017-07-01 13:09:58: Checking for database schema update...
2017-07-01 13:09:58: SELECT * FROM version LIMIT 1
2017-07-01 13:09:58: Current database version
2017-07-01 13:09:58: SELECT * FROM table_fields
2017-07-01 13:09:58: SELECT * FROM settings
2017-07-01 13:09:58: SELECT * FROM `folders` WHERE `id` = ?
2017-07-01 13:09:58: ["68cba53569c84bfbad79eee85402160b"]
2017-07-01 13:09:58: SELECT * FROM folders ORDER BY created_time DESC LIMIT 1
2017-07-01 13:09:58: SELECT * FROM `folders` WHERE `title` = ?
2017-07-01 13:09:58: ["Notebook-1498910969408-979"]
2017-07-01 13:09:58: SELECT * FROM folders WHERE sync_time < updated_time LIMIT 100
2017-07-01 13:09:58: SELECT * FROM notes WHERE sync_time < updated_time AND is_conflict = 0 LIMIT 100
2017-07-01 13:09:58: SELECT * FROM deleted_items
2017-07-01 13:09:58: SELECT id FROM folders WHERE sync_time > 0
2017-07-01 13:09:58: SELECT id FROM notes WHERE is_conflict = 0 AND sync_time > 0
2017-07-01 13:09:58: SELECT * FROM `folders` WHERE `id` = ?
2017-07-01 13:09:58: ["7711fd1e399e4219ba8f5f9e9eeefb16"]
2017-07-01 13:09:58: SELECT count(*) as total FROM `folders`
2017-07-01 13:10:01: Database was open successfully
2017-07-01 13:10:01: Checking for database schema update...
2017-07-01 13:10:01: SELECT * FROM version LIMIT 1
2017-07-01 13:10:01: Current database version
2017-07-01 13:10:01: SELECT * FROM table_fields
2017-07-01 13:10:01: SELECT * FROM settings
2017-07-01 13:10:01: SELECT * FROM `folders` WHERE `id` = ?
2017-07-01 13:10:01: ["68cba53569c84bfbad79eee85402160b"]
2017-07-01 13:10:01: SELECT * FROM folders ORDER BY created_time DESC LIMIT 1
2017-07-01 13:10:01: SELECT * FROM `folders` WHERE `title` = ?
2017-07-01 13:10:01: ["Notebook-1498910969408-979"]
2017-07-01 13:10:01: SELECT * FROM folders WHERE sync_time < updated_time LIMIT 100
2017-07-01 13:10:01: SELECT * FROM notes WHERE sync_time < updated_time AND is_conflict = 0 LIMIT 100
2017-07-01 13:10:01: SELECT * FROM deleted_items
2017-07-01 13:10:01: SELECT id FROM folders WHERE sync_time > 0
2017-07-01 13:10:01: SELECT id FROM notes WHERE is_conflict = 0 AND sync_time > 0
2017-07-01 13:10:01: SELECT * FROM `folders` WHERE `id` = ?
2017-07-01 13:10:01: ["7711fd1e399e4219ba8f5f9e9eeefb16"]
2017-07-01 13:10:01: SELECT count(*) as total FROM `folders`
2017-07-01 13:10:02: Database was open successfully
2017-07-01 13:10:02: Checking for database schema update...
2017-07-01 13:10:02: SELECT * FROM version LIMIT 1
2017-07-01 13:10:02: Current database version
2017-07-01 13:10:02: SELECT * FROM table_fields
2017-07-01 13:10:02: SELECT * FROM settings
2017-07-01 13:10:02: SELECT * FROM `folders` WHERE `id` = ?
2017-07-01 13:10:02: ["68cba53569c84bfbad79eee85402160b"]
2017-07-01 13:10:02: SELECT * FROM folders ORDER BY created_time DESC LIMIT 1
2017-07-01 13:10:02: SELECT * FROM `folders` WHERE `title` = ?
2017-07-01 13:10:02: ["Notebook-1498910969408-979"]
2017-07-01 13:10:02: SELECT * FROM `folders`
2017-07-01 13:10:02: SELECT `id`,`title`,`body`,`is_todo`,`todo_completed`,`parent_id`,`updated_time` FROM notes WHERE is_conflict = 0 AND parent_id = ? ORDER BY updated_time DESC
2017-07-01 13:10:02: ["7711fd1e399e4219ba8f5f9e9eeefb16"]

View File

@@ -1,92 +0,0 @@
2017-07-01 13:09:38: Starting synchronization... [1498910978635]
2017-07-01 13:09:38: Sync: createRemote: remote does not exist, and local is new and has never been synced: (Local 68cba53569c84bfbad79eee85402160b, "Notebook")
2017-07-01 13:09:38: Sync: deleteRemote: local has been deleted: (Remote 351b927410b541e1a6d1a2a88ef7d1c0)
2017-07-01 13:09:39: Synchronization complete [1498910978635]:
2017-07-01 13:09:39: remotesToUpdate: 1
2017-07-01 13:09:39: remotesToDelete: 1
2017-07-01 13:09:39: localsToUdpate: -
2017-07-01 13:09:39: localsToDelete: -
2017-07-01 13:09:39: createLocal: -
2017-07-01 13:09:39: updateLocal: -
2017-07-01 13:09:39: deleteLocal: -
2017-07-01 13:09:39: createRemote: 1
2017-07-01 13:09:39: updateRemote: -
2017-07-01 13:09:39: deleteRemote: 1
2017-07-01 13:09:39: folderConflict: -
2017-07-01 13:09:39: noteConflict: -
2017-07-01 13:09:39: Total folders: 1
2017-07-01 13:09:39: Total notes: 0
2017-07-01 13:09:42: Starting synchronization... [1498910982477]
2017-07-01 13:09:42: Sync: createLocal: remote exists but local does not: (Remote 7711fd1e399e4219ba8f5f9e9eeefb16, "Notebook")
2017-07-01 13:09:42: Synchronization complete [1498910982477]:
2017-07-01 13:09:42: remotesToUpdate: -
2017-07-01 13:09:42: remotesToDelete: -
2017-07-01 13:09:42: localsToUdpate: 1
2017-07-01 13:09:42: localsToDelete: -
2017-07-01 13:09:42: createLocal: 1
2017-07-01 13:09:42: updateLocal: -
2017-07-01 13:09:42: deleteLocal: -
2017-07-01 13:09:42: createRemote: -
2017-07-01 13:09:42: updateRemote: -
2017-07-01 13:09:42: deleteRemote: -
2017-07-01 13:09:42: folderConflict: -
2017-07-01 13:09:42: noteConflict: -
2017-07-01 13:09:42: Total folders: 2
2017-07-01 13:09:42: Total notes: 0
2017-07-01 13:09:45: Starting synchronization... [1498910985800]
2017-07-01 13:09:45: Sync: updateRemote: local has changes: (Local 7711fd1e399e4219ba8f5f9e9eeefb16, "Notebook-1498910969408-979"): (Remote )
2017-07-01 13:09:46: Sync: updateLocal: remote is more recent than local: (Local 68cba53569c84bfbad79eee85402160b, "Notebook"): (Remote 68cba53569c84bfbad79eee85402160b, "Notebook-1498910969401-461")
2017-07-01 13:09:46: Synchronization complete [1498910985800]:
2017-07-01 13:09:46: remotesToUpdate: 1
2017-07-01 13:09:46: remotesToDelete: -
2017-07-01 13:09:46: localsToUdpate: 1
2017-07-01 13:09:46: localsToDelete: -
2017-07-01 13:09:46: createLocal: -
2017-07-01 13:09:46: updateLocal: 1
2017-07-01 13:09:46: deleteLocal: -
2017-07-01 13:09:46: createRemote: -
2017-07-01 13:09:46: updateRemote: 1
2017-07-01 13:09:46: deleteRemote: -
2017-07-01 13:09:46: folderConflict: -
2017-07-01 13:09:46: noteConflict: -
2017-07-01 13:09:46: Total folders: 2
2017-07-01 13:09:46: Total notes: 0
2017-07-01 13:09:55: Starting synchronization... [1498910995526]
2017-07-01 13:09:55: Sync: deleteRemote: local has been deleted: (Remote 68cba53569c84bfbad79eee85402160b)
2017-07-01 13:09:55: Synchronization complete [1498910995526]:
2017-07-01 13:09:55: remotesToUpdate: -
2017-07-01 13:09:55: remotesToDelete: 1
2017-07-01 13:09:55: localsToUdpate: -
2017-07-01 13:09:55: localsToDelete: -
2017-07-01 13:09:55: createLocal: -
2017-07-01 13:09:55: updateLocal: -
2017-07-01 13:09:55: deleteLocal: -
2017-07-01 13:09:55: createRemote: -
2017-07-01 13:09:55: updateRemote: -
2017-07-01 13:09:55: deleteRemote: 1
2017-07-01 13:09:55: folderConflict: -
2017-07-01 13:09:55: noteConflict: -
2017-07-01 13:09:55: Total folders: 1
2017-07-01 13:09:55: Total notes: 0
2017-07-01 13:09:58: Starting synchronization... [1498910998834]
2017-07-01 13:09:58: Sync: deleteLocal: remote has been deleted: (Local 7711fd1e399e4219ba8f5f9e9eeefb16)
2017-07-01 13:09:58: Error: Cannot delete the last notebook
Error: Cannot delete the last notebook
at Function._callee$ (/mnt/d/Web/www/joplin/CliClient/app/lib/models/folder.js:59:25)
at tryCatch (/mnt/d/Web/www/joplin/CliClient/node_modules/regenerator-runtime/runtime.js:65:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/mnt/d/Web/www/joplin/CliClient/node_modules/regenerator-runtime/runtime.js:303:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/mnt/d/Web/www/joplin/CliClient/node_modules/regenerator-runtime/runtime.js:117:21)
at step (/mnt/d/Web/www/joplin/CliClient/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
at /mnt/d/Web/www/joplin/CliClient/node_modules/babel-runtime/helpers/asyncToGenerator.js:28:13
at process._tickCallback (internal/process/next_tick.js:109:7)
2017-07-01 13:10:01: Starting synchronization... [1498911001597]
2017-07-01 13:10:01: Sync: deleteLocal: remote has been deleted: (Local 7711fd1e399e4219ba8f5f9e9eeefb16)
2017-07-01 13:10:01: Error: Cannot delete the last notebook
Error: Cannot delete the last notebook
at Function._callee$ (/mnt/d/Web/www/joplin/CliClient/app/lib/models/folder.js:59:25)
at tryCatch (/mnt/d/Web/www/joplin/CliClient/node_modules/regenerator-runtime/runtime.js:65:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/mnt/d/Web/www/joplin/CliClient/node_modules/regenerator-runtime/runtime.js:303:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/mnt/d/Web/www/joplin/CliClient/node_modules/regenerator-runtime/runtime.js:117:21)
at step (/mnt/d/Web/www/joplin/CliClient/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
at /mnt/d/Web/www/joplin/CliClient/node_modules/babel-runtime/helpers/asyncToGenerator.js:28:13
at process._tickCallback (internal/process/next_tick.js:109:7)

View File

@@ -1,54 +0,0 @@
2017-07-01 13:09:29: Starting joplin-cli 0.8.27...
2017-07-01 13:09:29: Profile directory: /var/www/joplin/CliClient/tests/fuzzing/client0
2017-07-01 13:09:31: Starting joplin-cli 0.8.27...
2017-07-01 13:09:31: Profile directory: /var/www/joplin/CliClient/tests/fuzzing/client0
2017-07-01 13:09:33: Starting joplin-cli 0.8.27...
2017-07-01 13:09:33: Profile directory: /var/www/joplin/CliClient/tests/fuzzing/client0
2017-07-01 13:09:35: Starting joplin-cli 0.8.27...
2017-07-01 13:09:35: Profile directory: /var/www/joplin/CliClient/tests/fuzzing/client0
2017-07-01 13:09:36: Starting joplin-cli 0.8.27...
2017-07-01 13:09:36: Profile directory: /var/www/joplin/CliClient/tests/fuzzing/client0
2017-07-01 13:09:38: Starting joplin-cli 0.8.27...
2017-07-01 13:09:38: Profile directory: /var/www/joplin/CliClient/tests/fuzzing/client0
2017-07-01 13:09:38: mkdir /var/www/joplin/CliClient/tests/fuzzing/sync/.sync
2017-07-01 13:09:38: stat /var/www/joplin/CliClient/tests/fuzzing/sync/68cba53569c84bfbad79eee85402160b.md
2017-07-01 13:09:38: put /var/www/joplin/CliClient/tests/fuzzing/sync/.sync/68cba53569c84bfbad79eee85402160b.md_1498910978660
2017-07-01 13:09:38: setTimestamp /var/www/joplin/CliClient/tests/fuzzing/sync/.sync/68cba53569c84bfbad79eee85402160b.md_1498910978660
2017-07-01 13:09:38: move /var/www/joplin/CliClient/tests/fuzzing/sync/.sync/68cba53569c84bfbad79eee85402160b.md_1498910978660 => /var/www/joplin/CliClient/tests/fuzzing/sync/68cba53569c84bfbad79eee85402160b.md
2017-07-01 13:09:38: delete /var/www/joplin/CliClient/tests/fuzzing/sync/351b927410b541e1a6d1a2a88ef7d1c0.md
2017-07-01 13:09:39: list /var/www/joplin/CliClient/tests/fuzzing/sync
2017-07-01 13:09:42: Starting joplin-cli 0.8.27...
2017-07-01 13:09:42: Profile directory: /var/www/joplin/CliClient/tests/fuzzing/client0
2017-07-01 13:09:42: mkdir /var/www/joplin/CliClient/tests/fuzzing/sync/.sync
2017-07-01 13:09:42: list /var/www/joplin/CliClient/tests/fuzzing/sync
2017-07-01 13:09:42: get /var/www/joplin/CliClient/tests/fuzzing/sync/7711fd1e399e4219ba8f5f9e9eeefb16.md
2017-07-01 13:09:45: Starting joplin-cli 0.8.27...
2017-07-01 13:09:45: Profile directory: /var/www/joplin/CliClient/tests/fuzzing/client0
2017-07-01 13:09:45: mkdir /var/www/joplin/CliClient/tests/fuzzing/sync/.sync
2017-07-01 13:09:45: stat /var/www/joplin/CliClient/tests/fuzzing/sync/7711fd1e399e4219ba8f5f9e9eeefb16.md
2017-07-01 13:09:45: put /var/www/joplin/CliClient/tests/fuzzing/sync/.sync/7711fd1e399e4219ba8f5f9e9eeefb16.md_1498910985820
2017-07-01 13:09:45: setTimestamp /var/www/joplin/CliClient/tests/fuzzing/sync/.sync/7711fd1e399e4219ba8f5f9e9eeefb16.md_1498910985820
2017-07-01 13:09:45: move /var/www/joplin/CliClient/tests/fuzzing/sync/.sync/7711fd1e399e4219ba8f5f9e9eeefb16.md_1498910985820 => /var/www/joplin/CliClient/tests/fuzzing/sync/7711fd1e399e4219ba8f5f9e9eeefb16.md
2017-07-01 13:09:46: list /var/www/joplin/CliClient/tests/fuzzing/sync
2017-07-01 13:09:46: get /var/www/joplin/CliClient/tests/fuzzing/sync/68cba53569c84bfbad79eee85402160b.md
2017-07-01 13:09:47: Starting joplin-cli 0.8.27...
2017-07-01 13:09:47: Profile directory: /var/www/joplin/CliClient/tests/fuzzing/client0
2017-07-01 13:09:52: Starting joplin-cli 0.8.27...
2017-07-01 13:09:52: Profile directory: /var/www/joplin/CliClient/tests/fuzzing/client0
2017-07-01 13:09:53: Starting joplin-cli 0.8.27...
2017-07-01 13:09:53: Profile directory: /var/www/joplin/CliClient/tests/fuzzing/client0
2017-07-01 13:09:55: Starting joplin-cli 0.8.27...
2017-07-01 13:09:55: Profile directory: /var/www/joplin/CliClient/tests/fuzzing/client0
2017-07-01 13:09:55: mkdir /var/www/joplin/CliClient/tests/fuzzing/sync/.sync
2017-07-01 13:09:55: delete /var/www/joplin/CliClient/tests/fuzzing/sync/68cba53569c84bfbad79eee85402160b.md
2017-07-01 13:09:55: list /var/www/joplin/CliClient/tests/fuzzing/sync
2017-07-01 13:09:58: Starting joplin-cli 0.8.27...
2017-07-01 13:09:58: Profile directory: /var/www/joplin/CliClient/tests/fuzzing/client0
2017-07-01 13:09:58: mkdir /var/www/joplin/CliClient/tests/fuzzing/sync/.sync
2017-07-01 13:09:58: list /var/www/joplin/CliClient/tests/fuzzing/sync
2017-07-01 13:10:01: Starting joplin-cli 0.8.27...
2017-07-01 13:10:01: Profile directory: /var/www/joplin/CliClient/tests/fuzzing/client0
2017-07-01 13:10:01: mkdir /var/www/joplin/CliClient/tests/fuzzing/sync/.sync
2017-07-01 13:10:01: list /var/www/joplin/CliClient/tests/fuzzing/sync
2017-07-01 13:10:02: Starting joplin-cli 0.8.27...
2017-07-01 13:10:02: Profile directory: /var/www/joplin/CliClient/tests/fuzzing/client0

View File

@@ -1,454 +0,0 @@
2017-07-01 13:09:29: Database was open successfully
2017-07-01 13:09:29: Checking for database schema update...
2017-07-01 13:09:29: SELECT * FROM version LIMIT 1
2017-07-01 13:09:29: Database is new - creating the schema...
2017-07-01 13:09:29: BEGIN TRANSACTION
2017-07-01 13:09:29: CREATE TABLE folders ( id TEXT PRIMARY KEY, parent_id TEXT NOT NULL DEFAULT "", title TEXT NOT NULL DEFAULT "", created_time INT NOT NULL DEFAULT 0, updated_time INT NOT NULL DEFAULT 0, sync_time INT NOT NULL DEFAULT 0);
2017-07-01 13:09:29: CREATE INDEX folders_title ON folders (title);
2017-07-01 13:09:29: CREATE INDEX folders_updated_time ON folders (updated_time);
2017-07-01 13:09:29: CREATE INDEX folders_sync_time ON folders (sync_time);
2017-07-01 13:09:29: CREATE TABLE notes ( id TEXT PRIMARY KEY, parent_id TEXT NOT NULL DEFAULT "", title TEXT NOT NULL DEFAULT "", body TEXT NOT NULL DEFAULT "", created_time INT NOT NULL DEFAULT 0, updated_time INT NOT NULL DEFAULT 0, sync_time INT NOT NULL DEFAULT 0, is_conflict INT NOT NULL DEFAULT 0, latitude NUMERIC NOT NULL DEFAULT 0, longitude NUMERIC NOT NULL DEFAULT 0, altitude NUMERIC NOT NULL DEFAULT 0, author TEXT NOT NULL DEFAULT "", source_url TEXT NOT NULL DEFAULT "", is_todo INT NOT NULL DEFAULT 0, todo_due INT NOT NULL DEFAULT 0, todo_completed INT NOT NULL DEFAULT 0, source TEXT NOT NULL DEFAULT "", source_application TEXT NOT NULL DEFAULT "", application_data TEXT NOT NULL DEFAULT "", `order` INT NOT NULL DEFAULT 0);
2017-07-01 13:09:29: CREATE INDEX notes_title ON notes (title);
2017-07-01 13:09:29: CREATE INDEX notes_updated_time ON notes (updated_time);
2017-07-01 13:09:29: CREATE INDEX notes_sync_time ON notes (sync_time);
2017-07-01 13:09:29: CREATE INDEX notes_is_conflict ON notes (is_conflict);
2017-07-01 13:09:29: CREATE INDEX notes_is_todo ON notes (is_todo);
2017-07-01 13:09:29: CREATE INDEX notes_order ON notes (`order`);
2017-07-01 13:09:29: CREATE TABLE deleted_items ( id INTEGER PRIMARY KEY, item_type INT NOT NULL, item_id TEXT NOT NULL, deleted_time INT NOT NULL);
2017-07-01 13:09:29: CREATE TABLE tags ( id TEXT PRIMARY KEY, title TEXT, created_time INT, updated_time INT);
2017-07-01 13:09:29: CREATE TABLE note_tags ( id INTEGER PRIMARY KEY, note_id TEXT, tag_id TEXT);
2017-07-01 13:09:29: CREATE TABLE resources ( id TEXT PRIMARY KEY, title TEXT, mime TEXT, filename TEXT, created_time INT, updated_time INT);
2017-07-01 13:09:29: CREATE TABLE note_resources ( id INTEGER PRIMARY KEY, note_id TEXT, resource_id TEXT);
2017-07-01 13:09:29: CREATE TABLE version ( version INT);
2017-07-01 13:09:29: CREATE TABLE changes ( id INTEGER PRIMARY KEY, `type` INT, item_id TEXT, item_type INT, item_field TEXT);
2017-07-01 13:09:29: CREATE TABLE settings ( `key` TEXT PRIMARY KEY, `value` TEXT, `type` INT);
2017-07-01 13:09:29: CREATE TABLE table_fields ( id INTEGER PRIMARY KEY, table_name TEXT, field_name TEXT, field_type INT, field_default TEXT);
2017-07-01 13:09:29: CREATE TABLE item_sync_times ( id INTEGER PRIMARY KEY, item_id TEXT, `time` INT);
2017-07-01 13:09:29: INSERT INTO version (version) VALUES (1);
2017-07-01 13:09:29: INSERT INTO settings (`key`, `value`, `type`) VALUES ("clientId", "7b3e8c87485342b48080ef4c71bc3deb", "2")
2017-07-01 13:09:29: INSERT INTO `folders` (`id`, `title`, `created_time`, `updated_time`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:29: ["7711fd1e399e4219ba8f5f9e9eeefb16","Notebook",1498910969408,1498910969408]
2017-07-01 13:09:29: COMMIT
2017-07-01 13:09:29: Database schema created successfully
2017-07-01 13:09:29: Initializing tables...
2017-07-01 13:09:29: SELECT name FROM sqlite_master WHERE type="table"
2017-07-01 13:09:29: PRAGMA table_info("folders")
2017-07-01 13:09:29: PRAGMA table_info("notes")
2017-07-01 13:09:29: PRAGMA table_info("deleted_items")
2017-07-01 13:09:29: PRAGMA table_info("tags")
2017-07-01 13:09:29: PRAGMA table_info("note_tags")
2017-07-01 13:09:29: PRAGMA table_info("resources")
2017-07-01 13:09:29: PRAGMA table_info("note_resources")
2017-07-01 13:09:29: PRAGMA table_info("version")
2017-07-01 13:09:29: PRAGMA table_info("changes")
2017-07-01 13:09:29: PRAGMA table_info("settings")
2017-07-01 13:09:29: PRAGMA table_info("item_sync_times")
2017-07-01 13:09:29: BEGIN TRANSACTION
2017-07-01 13:09:29: DELETE FROM table_fields
2017-07-01 13:09:29: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:29: ["folders","id",2,null]
2017-07-01 13:09:29: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:29: ["folders","parent_id",2,""]
2017-07-01 13:09:29: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["folders","title",2,""]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["folders","created_time",1,"0"]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["folders","updated_time",1,"0"]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["folders","sync_time",1,"0"]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["notes","id",2,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["notes","parent_id",2,""]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["notes","title",2,""]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["notes","body",2,""]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["notes","created_time",1,"0"]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["notes","updated_time",1,"0"]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["notes","sync_time",1,"0"]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["notes","is_conflict",1,"0"]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["notes","latitude",3,"0"]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["notes","longitude",3,"0"]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["notes","altitude",3,"0"]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["notes","author",2,""]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["notes","source_url",2,""]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["notes","is_todo",1,"0"]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["notes","todo_due",1,"0"]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["notes","todo_completed",1,"0"]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["notes","source",2,""]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["notes","source_application",2,""]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["notes","application_data",2,""]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["notes","order",1,"0"]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["deleted_items","id",null,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["deleted_items","item_type",1,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["deleted_items","item_id",2,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["deleted_items","deleted_time",1,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["tags","id",2,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["tags","title",2,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["tags","created_time",1,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["tags","updated_time",1,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["note_tags","id",null,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["note_tags","note_id",2,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["note_tags","tag_id",2,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["resources","id",2,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["resources","title",2,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["resources","mime",2,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["resources","filename",2,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["resources","created_time",1,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["resources","updated_time",1,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["note_resources","id",null,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["note_resources","note_id",2,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["note_resources","resource_id",2,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["version","version",1,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["changes","id",null,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["changes","type",1,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["changes","item_id",2,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["changes","item_type",1,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["changes","item_field",2,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["settings","key",2,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["settings","value",2,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["settings","type",1,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["item_sync_times","id",null,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["item_sync_times","item_id",2,null]
2017-07-01 13:09:30: INSERT INTO `table_fields` (`table_name`, `field_name`, `field_type`, `field_default`) VALUES (?, ?, ?, ?)
2017-07-01 13:09:30: ["item_sync_times","time",1,null]
2017-07-01 13:09:30: COMMIT
2017-07-01 13:09:30: Checking for database schema update...
2017-07-01 13:09:30: SELECT * FROM version LIMIT 1
2017-07-01 13:09:30: Current database version
2017-07-01 13:09:30: SELECT * FROM table_fields
2017-07-01 13:09:30: SELECT * FROM settings
2017-07-01 13:09:30: SELECT * FROM folders ORDER BY created_time DESC LIMIT 1
2017-07-01 13:09:30: SELECT * FROM `folders` WHERE `title` = ?
2017-07-01 13:09:30: ["Notebook"]
2017-07-01 13:09:30: Saving settings...
2017-07-01 13:09:30: BEGIN TRANSACTION
2017-07-01 13:09:30: DELETE FROM settings
2017-07-01 13:09:30: INSERT INTO `settings` (`key`, `value`, `type`) VALUES (?, ?, ?)
2017-07-01 13:09:30: ["clientId","7b3e8c87485342b48080ef4c71bc3deb",2]
2017-07-01 13:09:30: INSERT INTO `settings` (`value`, `type`, `key`) VALUES (?, ?, ?)
2017-07-01 13:09:30: ["7711fd1e399e4219ba8f5f9e9eeefb16","string","activeFolderId"]
2017-07-01 13:09:30: INSERT INTO `settings` (`value`, `type`, `key`) VALUES (?, ?, ?)
2017-07-01 13:09:30: ["local","string","sync.target"]
2017-07-01 13:09:30: COMMIT
2017-07-01 13:09:30: Settings have been saved.
2017-07-01 13:09:32: Database was open successfully
2017-07-01 13:09:32: Checking for database schema update...
2017-07-01 13:09:32: SELECT * FROM version LIMIT 1
2017-07-01 13:09:32: Current database version
2017-07-01 13:09:32: SELECT * FROM table_fields
2017-07-01 13:09:32: SELECT * FROM settings
2017-07-01 13:09:32: SELECT * FROM `folders` WHERE `id` = ?
2017-07-01 13:09:32: ["7711fd1e399e4219ba8f5f9e9eeefb16"]
2017-07-01 13:09:32: SELECT * FROM `folders` WHERE `title` = ?
2017-07-01 13:09:32: ["Notebook"]
2017-07-01 13:09:32: Saving settings...
2017-07-01 13:09:32: BEGIN TRANSACTION
2017-07-01 13:09:32: DELETE FROM settings
2017-07-01 13:09:32: INSERT INTO `settings` (`key`, `value`, `type`) VALUES (?, ?, ?)
2017-07-01 13:09:32: ["clientId","7b3e8c87485342b48080ef4c71bc3deb",2]
2017-07-01 13:09:32: INSERT INTO `settings` (`key`, `value`, `type`) VALUES (?, ?, ?)
2017-07-01 13:09:32: ["activeFolderId","7711fd1e399e4219ba8f5f9e9eeefb16","string"]
2017-07-01 13:09:32: INSERT INTO `settings` (`key`, `value`, `type`) VALUES (?, ?, ?)
2017-07-01 13:09:32: ["sync.target","local","string"]
2017-07-01 13:09:32: INSERT INTO `settings` (`value`, `type`, `key`) VALUES (?, ?, ?)
2017-07-01 13:09:32: ["/var/www/joplin/CliClient/tests/fuzzing/sync","string","sync.local.path"]
2017-07-01 13:09:32: COMMIT
2017-07-01 13:09:32: Settings have been saved.
2017-07-01 13:09:33: Database was open successfully
2017-07-01 13:09:33: Checking for database schema update...
2017-07-01 13:09:33: SELECT * FROM version LIMIT 1
2017-07-01 13:09:33: Current database version
2017-07-01 13:09:33: SELECT * FROM table_fields
2017-07-01 13:09:33: SELECT * FROM settings
2017-07-01 13:09:33: SELECT * FROM `folders` WHERE `id` = ?
2017-07-01 13:09:33: ["7711fd1e399e4219ba8f5f9e9eeefb16"]
2017-07-01 13:09:33: SELECT * FROM `folders` WHERE `title` = ?
2017-07-01 13:09:33: ["Notebook"]
2017-07-01 13:09:33: SELECT * FROM `folders`
2017-07-01 13:09:33: SELECT `id`,`title`,`body`,`is_todo`,`todo_completed`,`parent_id`,`updated_time` FROM notes WHERE is_conflict = 0 AND parent_id = ? ORDER BY updated_time DESC
2017-07-01 13:09:33: ["7711fd1e399e4219ba8f5f9e9eeefb16"]
2017-07-01 13:09:35: Database was open successfully
2017-07-01 13:09:35: Checking for database schema update...
2017-07-01 13:09:35: SELECT * FROM version LIMIT 1
2017-07-01 13:09:35: Current database version
2017-07-01 13:09:35: SELECT * FROM table_fields
2017-07-01 13:09:35: SELECT * FROM settings
2017-07-01 13:09:35: SELECT * FROM `folders` WHERE `id` = ?
2017-07-01 13:09:35: ["7711fd1e399e4219ba8f5f9e9eeefb16"]
2017-07-01 13:09:35: SELECT * FROM `folders` WHERE `title` = ?
2017-07-01 13:09:35: ["Notebook"]
2017-07-01 13:09:35: SELECT * FROM `folders` WHERE `title` = ?
2017-07-01 13:09:35: ["Notebook"]
2017-07-01 13:09:35: SELECT * FROM `folders` WHERE `id` = ?
2017-07-01 13:09:35: ["7711fd1e399e4219ba8f5f9e9eeefb16"]
2017-07-01 13:09:35: SELECT count(*) as total FROM `folders`
2017-07-01 13:09:40: Database was open successfully
2017-07-01 13:09:40: Checking for database schema update...
2017-07-01 13:09:40: SELECT * FROM version LIMIT 1
2017-07-01 13:09:40: Current database version
2017-07-01 13:09:40: SELECT * FROM table_fields
2017-07-01 13:09:40: SELECT * FROM settings
2017-07-01 13:09:40: SELECT * FROM `folders` WHERE `id` = ?
2017-07-01 13:09:40: ["7711fd1e399e4219ba8f5f9e9eeefb16"]
2017-07-01 13:09:40: SELECT * FROM `folders` WHERE `title` = ?
2017-07-01 13:09:40: ["Notebook"]
2017-07-01 13:09:40: SELECT * FROM folders WHERE sync_time < updated_time LIMIT 100
2017-07-01 13:09:40: SELECT * FROM `folders` WHERE `title` = ?
2017-07-01 13:09:40: [null]
2017-07-01 13:09:40: UPDATE `folders` SET `sync_time`=? WHERE id=?
2017-07-01 13:09:40: [1498910980584,"7711fd1e399e4219ba8f5f9e9eeefb16"]
2017-07-01 13:09:40: SELECT * FROM folders WHERE sync_time < updated_time LIMIT 100
2017-07-01 13:09:40: SELECT * FROM notes WHERE sync_time < updated_time AND is_conflict = 0 LIMIT 100
2017-07-01 13:09:40: SELECT * FROM deleted_items
2017-07-01 13:09:40: SELECT * FROM `notes` WHERE `id` = ?
2017-07-01 13:09:40: ["68cba53569c84bfbad79eee85402160b"]
2017-07-01 13:09:40: SELECT * FROM `folders` WHERE `id` = ?
2017-07-01 13:09:40: ["68cba53569c84bfbad79eee85402160b"]
2017-07-01 13:09:40: SELECT * FROM `folders` WHERE `title` = ?
2017-07-01 13:09:40: ["Notebook"]
2017-07-01 13:09:40: SELECT * FROM `folders` WHERE `title` = ?
2017-07-01 13:09:40: ["Notebook-1498910969401-461"]
2017-07-01 13:09:40: INSERT INTO `folders` (`id`, `title`, `created_time`, `updated_time`, `sync_time`) VALUES (?, ?, ?, ?, ?)
2017-07-01 13:09:40: ["68cba53569c84bfbad79eee85402160b","Notebook-1498910969401-461","1498910969401",1498910980801,1498910980799]
2017-07-01 13:09:41: SELECT * FROM `notes` WHERE `id` = ?
2017-07-01 13:09:41: ["7711fd1e399e4219ba8f5f9e9eeefb16"]
2017-07-01 13:09:41: SELECT * FROM `folders` WHERE `id` = ?
2017-07-01 13:09:41: ["7711fd1e399e4219ba8f5f9e9eeefb16"]
2017-07-01 13:09:41: SELECT id FROM folders WHERE sync_time > 0
2017-07-01 13:09:41: SELECT id FROM notes WHERE is_conflict = 0 AND sync_time > 0
2017-07-01 13:09:41: SELECT count(*) as total FROM `folders`
2017-07-01 13:09:41: SELECT count(*) as total FROM `notes`
2017-07-01 13:09:43: Database was open successfully
2017-07-01 13:09:43: Checking for database schema update...
2017-07-01 13:09:44: SELECT * FROM version LIMIT 1
2017-07-01 13:09:44: Current database version
2017-07-01 13:09:44: SELECT * FROM table_fields
2017-07-01 13:09:44: SELECT * FROM settings
2017-07-01 13:09:44: SELECT * FROM `folders` WHERE `id` = ?
2017-07-01 13:09:44: ["7711fd1e399e4219ba8f5f9e9eeefb16"]
2017-07-01 13:09:44: SELECT * FROM `folders` WHERE `title` = ?
2017-07-01 13:09:44: ["Notebook"]
2017-07-01 13:09:44: SELECT * FROM folders WHERE sync_time < updated_time LIMIT 100
2017-07-01 13:09:44: SELECT * FROM `folders` WHERE `title` = ?
2017-07-01 13:09:44: [null]
2017-07-01 13:09:44: UPDATE `folders` SET `sync_time`=? WHERE id=?
2017-07-01 13:09:44: [1498910984142,"68cba53569c84bfbad79eee85402160b"]
2017-07-01 13:09:44: SELECT * FROM folders WHERE sync_time < updated_time LIMIT 100
2017-07-01 13:09:44: SELECT * FROM notes WHERE sync_time < updated_time AND is_conflict = 0 LIMIT 100
2017-07-01 13:09:44: SELECT * FROM deleted_items
2017-07-01 13:09:44: SELECT * FROM `notes` WHERE `id` = ?
2017-07-01 13:09:44: ["68cba53569c84bfbad79eee85402160b"]
2017-07-01 13:09:44: SELECT * FROM `folders` WHERE `id` = ?
2017-07-01 13:09:44: ["68cba53569c84bfbad79eee85402160b"]
2017-07-01 13:09:44: SELECT * FROM `notes` WHERE `id` = ?
2017-07-01 13:09:44: ["7711fd1e399e4219ba8f5f9e9eeefb16"]
2017-07-01 13:09:44: SELECT * FROM `folders` WHERE `id` = ?
2017-07-01 13:09:44: ["7711fd1e399e4219ba8f5f9e9eeefb16"]
2017-07-01 13:09:44: SELECT id FROM folders WHERE sync_time > 0
2017-07-01 13:09:44: SELECT id FROM notes WHERE is_conflict = 0 AND sync_time > 0
2017-07-01 13:09:44: SELECT count(*) as total FROM `folders`
2017-07-01 13:09:44: SELECT count(*) as total FROM `notes`
2017-07-01 13:09:48: Database was open successfully
2017-07-01 13:09:48: Checking for database schema update...
2017-07-01 13:09:48: SELECT * FROM version LIMIT 1
2017-07-01 13:09:48: Current database version
2017-07-01 13:09:48: SELECT * FROM table_fields
2017-07-01 13:09:48: SELECT * FROM settings
2017-07-01 13:09:48: SELECT * FROM `folders` WHERE `id` = ?
2017-07-01 13:09:48: ["7711fd1e399e4219ba8f5f9e9eeefb16"]
2017-07-01 13:09:48: SELECT * FROM `folders` WHERE `title` = ?
2017-07-01 13:09:48: ["Notebook"]
2017-07-01 13:09:48: SELECT * FROM folders WHERE sync_time < updated_time LIMIT 100
2017-07-01 13:09:48: SELECT * FROM notes WHERE sync_time < updated_time AND is_conflict = 0 LIMIT 100
2017-07-01 13:09:48: SELECT * FROM deleted_items
2017-07-01 13:09:49: SELECT * FROM `notes` WHERE `id` = ?
2017-07-01 13:09:49: ["68cba53569c84bfbad79eee85402160b"]
2017-07-01 13:09:49: SELECT * FROM `folders` WHERE `id` = ?
2017-07-01 13:09:49: ["68cba53569c84bfbad79eee85402160b"]
2017-07-01 13:09:49: SELECT * FROM `notes` WHERE `id` = ?
2017-07-01 13:09:49: ["7711fd1e399e4219ba8f5f9e9eeefb16"]
2017-07-01 13:09:49: SELECT * FROM `folders` WHERE `id` = ?
2017-07-01 13:09:49: ["7711fd1e399e4219ba8f5f9e9eeefb16"]
2017-07-01 13:09:49: SELECT * FROM `folders` WHERE `title` = ?
2017-07-01 13:09:49: ["Notebook-1498910969408-979"]
2017-07-01 13:09:49: UPDATE `folders` SET `title`=?, `created_time`=?, `updated_time`=?, `sync_time`=? WHERE id=?
2017-07-01 13:09:49: ["Notebook-1498910969408-979","1498910969408","1498910982544",1498910989054,"7711fd1e399e4219ba8f5f9e9eeefb16"]
2017-07-01 13:09:49: SELECT id FROM folders WHERE sync_time > 0
2017-07-01 13:09:49: SELECT id FROM notes WHERE is_conflict = 0 AND sync_time > 0
2017-07-01 13:09:49: SELECT count(*) as total FROM `folders`
2017-07-01 13:09:49: SELECT count(*) as total FROM `notes`
2017-07-01 13:09:50: Database was open successfully
2017-07-01 13:09:50: Checking for database schema update...
2017-07-01 13:09:50: SELECT * FROM version LIMIT 1
2017-07-01 13:09:50: Current database version
2017-07-01 13:09:50: SELECT * FROM table_fields
2017-07-01 13:09:50: SELECT * FROM settings
2017-07-01 13:09:50: SELECT * FROM `folders` WHERE `id` = ?
2017-07-01 13:09:50: ["7711fd1e399e4219ba8f5f9e9eeefb16"]
2017-07-01 13:09:50: SELECT * FROM `folders` WHERE `title` = ?
2017-07-01 13:09:50: ["Notebook-1498910969408-979"]
2017-07-01 13:09:50: SELECT * FROM `folders`
2017-07-01 13:09:50: SELECT `id`,`title`,`body`,`is_todo`,`todo_completed`,`parent_id`,`updated_time` FROM notes WHERE is_conflict = 0 AND parent_id = ? ORDER BY updated_time DESC
2017-07-01 13:09:50: ["7711fd1e399e4219ba8f5f9e9eeefb16"]
2017-07-01 13:09:50: SELECT `id`,`title`,`body`,`is_todo`,`todo_completed`,`parent_id`,`updated_time` FROM notes WHERE is_conflict = 0 AND parent_id = ? ORDER BY updated_time DESC
2017-07-01 13:09:50: ["68cba53569c84bfbad79eee85402160b"]
2017-07-01 13:09:52: Database was open successfully
2017-07-01 13:09:52: Checking for database schema update...
2017-07-01 13:09:52: SELECT * FROM version LIMIT 1
2017-07-01 13:09:52: Current database version
2017-07-01 13:09:52: SELECT * FROM table_fields
2017-07-01 13:09:52: SELECT * FROM settings
2017-07-01 13:09:52: SELECT * FROM `folders` WHERE `id` = ?
2017-07-01 13:09:52: ["7711fd1e399e4219ba8f5f9e9eeefb16"]
2017-07-01 13:09:52: SELECT * FROM `folders` WHERE `title` = ?
2017-07-01 13:09:52: ["Notebook-1498910969408-979"]
2017-07-01 13:09:52: SELECT * FROM `folders`
2017-07-01 13:09:52: SELECT `id`,`title`,`body`,`is_todo`,`todo_completed`,`parent_id`,`updated_time` FROM notes WHERE is_conflict = 0 AND parent_id = ? ORDER BY updated_time DESC
2017-07-01 13:09:52: ["7711fd1e399e4219ba8f5f9e9eeefb16"]
2017-07-01 13:09:52: SELECT `id`,`title`,`body`,`is_todo`,`todo_completed`,`parent_id`,`updated_time` FROM notes WHERE is_conflict = 0 AND parent_id = ? ORDER BY updated_time DESC
2017-07-01 13:09:52: ["68cba53569c84bfbad79eee85402160b"]
2017-07-01 13:09:53: Database was open successfully
2017-07-01 13:09:53: Checking for database schema update...
2017-07-01 13:09:53: SELECT * FROM version LIMIT 1
2017-07-01 13:09:53: Current database version
2017-07-01 13:09:53: SELECT * FROM table_fields
2017-07-01 13:09:53: SELECT * FROM settings
2017-07-01 13:09:53: SELECT * FROM `folders` WHERE `id` = ?
2017-07-01 13:09:53: ["7711fd1e399e4219ba8f5f9e9eeefb16"]
2017-07-01 13:09:53: SELECT * FROM `folders` WHERE `title` = ?
2017-07-01 13:09:53: ["Notebook-1498910969408-979"]
2017-07-01 13:09:53: SELECT * FROM `folders` WHERE `title` = ?
2017-07-01 13:09:53: ["Notebook-1498910969408-979"]
2017-07-01 13:09:53: SELECT * FROM `folders` WHERE `id` = ?
2017-07-01 13:09:53: ["7711fd1e399e4219ba8f5f9e9eeefb16"]
2017-07-01 13:09:53: SELECT count(*) as total FROM `folders`
2017-07-01 13:09:53: SELECT id FROM notes WHERE is_conflict = 0 AND parent_id = ?
2017-07-01 13:09:53: ["7711fd1e399e4219ba8f5f9e9eeefb16"]
2017-07-01 13:09:53: DELETE FROM folders WHERE id = ?
2017-07-01 13:09:53: ["7711fd1e399e4219ba8f5f9e9eeefb16"]
2017-07-01 13:09:53: INSERT INTO deleted_items (item_type, item_id, deleted_time) VALUES (?, ?, ?)
2017-07-01 13:09:53: [2,"7711fd1e399e4219ba8f5f9e9eeefb16",1498910993660]
2017-07-01 13:09:53: SELECT * FROM folders ORDER BY created_time DESC LIMIT 1
2017-07-01 13:09:57: Database was open successfully
2017-07-01 13:09:57: Checking for database schema update...
2017-07-01 13:09:57: SELECT * FROM version LIMIT 1
2017-07-01 13:09:57: Current database version
2017-07-01 13:09:57: SELECT * FROM table_fields
2017-07-01 13:09:57: SELECT * FROM settings
2017-07-01 13:09:57: SELECT * FROM `folders` WHERE `id` = ?
2017-07-01 13:09:57: ["7711fd1e399e4219ba8f5f9e9eeefb16"]
2017-07-01 13:09:57: SELECT * FROM folders ORDER BY created_time DESC LIMIT 1
2017-07-01 13:09:57: SELECT * FROM `folders` WHERE `title` = ?
2017-07-01 13:09:57: ["Notebook-1498910969401-461"]
2017-07-01 13:09:57: SELECT * FROM folders WHERE sync_time < updated_time LIMIT 100
2017-07-01 13:09:57: SELECT * FROM notes WHERE sync_time < updated_time AND is_conflict = 0 LIMIT 100
2017-07-01 13:09:57: SELECT * FROM deleted_items
2017-07-01 13:09:57: DELETE FROM deleted_items WHERE item_id = ?
2017-07-01 13:09:57: ["7711fd1e399e4219ba8f5f9e9eeefb16"]
2017-07-01 13:09:57: SELECT id FROM folders WHERE sync_time > 0
2017-07-01 13:09:57: SELECT id FROM notes WHERE is_conflict = 0 AND sync_time > 0
2017-07-01 13:09:57: SELECT * FROM `folders` WHERE `id` = ?
2017-07-01 13:09:57: ["68cba53569c84bfbad79eee85402160b"]
2017-07-01 13:09:57: SELECT count(*) as total FROM `folders`
2017-07-01 13:10:00: Database was open successfully
2017-07-01 13:10:00: Checking for database schema update...
2017-07-01 13:10:00: SELECT * FROM version LIMIT 1
2017-07-01 13:10:00: Current database version
2017-07-01 13:10:00: SELECT * FROM table_fields
2017-07-01 13:10:00: SELECT * FROM settings
2017-07-01 13:10:00: SELECT * FROM `folders` WHERE `id` = ?
2017-07-01 13:10:00: ["7711fd1e399e4219ba8f5f9e9eeefb16"]
2017-07-01 13:10:00: SELECT * FROM folders ORDER BY created_time DESC LIMIT 1
2017-07-01 13:10:00: SELECT * FROM `folders` WHERE `title` = ?
2017-07-01 13:10:00: ["Notebook-1498910969401-461"]
2017-07-01 13:10:00: SELECT * FROM folders WHERE sync_time < updated_time LIMIT 100
2017-07-01 13:10:00: SELECT * FROM notes WHERE sync_time < updated_time AND is_conflict = 0 LIMIT 100
2017-07-01 13:10:00: SELECT * FROM deleted_items
2017-07-01 13:10:00: SELECT id FROM folders WHERE sync_time > 0
2017-07-01 13:10:00: SELECT id FROM notes WHERE is_conflict = 0 AND sync_time > 0
2017-07-01 13:10:00: SELECT * FROM `folders` WHERE `id` = ?
2017-07-01 13:10:00: ["68cba53569c84bfbad79eee85402160b"]
2017-07-01 13:10:00: SELECT count(*) as total FROM `folders`
2017-07-01 13:10:04: Database was open successfully
2017-07-01 13:10:04: Checking for database schema update...
2017-07-01 13:10:04: SELECT * FROM version LIMIT 1
2017-07-01 13:10:04: Current database version
2017-07-01 13:10:04: SELECT * FROM table_fields
2017-07-01 13:10:04: SELECT * FROM settings
2017-07-01 13:10:04: SELECT * FROM `folders` WHERE `id` = ?
2017-07-01 13:10:04: ["7711fd1e399e4219ba8f5f9e9eeefb16"]
2017-07-01 13:10:04: SELECT * FROM folders ORDER BY created_time DESC LIMIT 1
2017-07-01 13:10:04: SELECT * FROM `folders` WHERE `title` = ?
2017-07-01 13:10:04: ["Notebook-1498910969401-461"]
2017-07-01 13:10:04: SELECT * FROM folders WHERE sync_time < updated_time LIMIT 100
2017-07-01 13:10:04: SELECT * FROM notes WHERE sync_time < updated_time AND is_conflict = 0 LIMIT 100
2017-07-01 13:10:04: SELECT * FROM deleted_items
2017-07-01 13:10:04: SELECT id FROM folders WHERE sync_time > 0
2017-07-01 13:10:04: SELECT id FROM notes WHERE is_conflict = 0 AND sync_time > 0
2017-07-01 13:10:04: SELECT * FROM `folders` WHERE `id` = ?
2017-07-01 13:10:04: ["68cba53569c84bfbad79eee85402160b"]
2017-07-01 13:10:04: SELECT count(*) as total FROM `folders`
2017-07-01 13:10:05: Database was open successfully
2017-07-01 13:10:05: Checking for database schema update...
2017-07-01 13:10:05: SELECT * FROM version LIMIT 1
2017-07-01 13:10:05: Current database version
2017-07-01 13:10:05: SELECT * FROM table_fields
2017-07-01 13:10:05: SELECT * FROM settings
2017-07-01 13:10:05: SELECT * FROM `folders` WHERE `id` = ?
2017-07-01 13:10:05: ["7711fd1e399e4219ba8f5f9e9eeefb16"]
2017-07-01 13:10:05: SELECT * FROM folders ORDER BY created_time DESC LIMIT 1
2017-07-01 13:10:05: SELECT * FROM `folders` WHERE `title` = ?
2017-07-01 13:10:05: ["Notebook-1498910969401-461"]
2017-07-01 13:10:05: SELECT * FROM `folders`
2017-07-01 13:10:05: SELECT `id`,`title`,`body`,`is_todo`,`todo_completed`,`parent_id`,`updated_time` FROM notes WHERE is_conflict = 0 AND parent_id = ? ORDER BY updated_time DESC
2017-07-01 13:10:05: ["68cba53569c84bfbad79eee85402160b"]

View File

@@ -1,86 +0,0 @@
2017-07-01 13:09:40: Starting synchronization... [1498910980547]
2017-07-01 13:09:40: Sync: createRemote: remote does not exist, and local is new and has never been synced: (Local 7711fd1e399e4219ba8f5f9e9eeefb16, "Notebook")
2017-07-01 13:09:40: Sync: createLocal: remote exists but local does not: (Remote 68cba53569c84bfbad79eee85402160b, "Notebook")
2017-07-01 13:09:41: Synchronization complete [1498910980547]:
2017-07-01 13:09:41: remotesToUpdate: 1
2017-07-01 13:09:41: remotesToDelete: -
2017-07-01 13:09:41: localsToUdpate: 1
2017-07-01 13:09:41: localsToDelete: -
2017-07-01 13:09:41: createLocal: 1
2017-07-01 13:09:41: updateLocal: -
2017-07-01 13:09:41: deleteLocal: -
2017-07-01 13:09:41: createRemote: 1
2017-07-01 13:09:41: updateRemote: -
2017-07-01 13:09:41: deleteRemote: -
2017-07-01 13:09:41: folderConflict: -
2017-07-01 13:09:41: noteConflict: -
2017-07-01 13:09:41: Total folders: 2
2017-07-01 13:09:41: Total notes: 0
2017-07-01 13:09:44: Starting synchronization... [1498910984088]
2017-07-01 13:09:44: Sync: updateRemote: local has changes: (Local 68cba53569c84bfbad79eee85402160b, "Notebook-1498910969401-461"): (Remote )
2017-07-01 13:09:44: Synchronization complete [1498910984088]:
2017-07-01 13:09:44: remotesToUpdate: 1
2017-07-01 13:09:44: remotesToDelete: -
2017-07-01 13:09:44: localsToUdpate: -
2017-07-01 13:09:44: localsToDelete: -
2017-07-01 13:09:44: createLocal: -
2017-07-01 13:09:44: updateLocal: -
2017-07-01 13:09:44: deleteLocal: -
2017-07-01 13:09:44: createRemote: -
2017-07-01 13:09:44: updateRemote: 1
2017-07-01 13:09:44: deleteRemote: -
2017-07-01 13:09:44: folderConflict: -
2017-07-01 13:09:44: noteConflict: -
2017-07-01 13:09:44: Total folders: 2
2017-07-01 13:09:44: Total notes: 0
2017-07-01 13:09:48: Starting synchronization... [1498910988979]
2017-07-01 13:09:49: Sync: updateLocal: remote is more recent than local: (Local 7711fd1e399e4219ba8f5f9e9eeefb16, "Notebook"): (Remote 7711fd1e399e4219ba8f5f9e9eeefb16, "Notebook-1498910969408-979")
2017-07-01 13:09:49: Synchronization complete [1498910988979]:
2017-07-01 13:09:49: remotesToUpdate: -
2017-07-01 13:09:49: remotesToDelete: -
2017-07-01 13:09:49: localsToUdpate: 1
2017-07-01 13:09:49: localsToDelete: -
2017-07-01 13:09:49: createLocal: -
2017-07-01 13:09:49: updateLocal: 1
2017-07-01 13:09:49: deleteLocal: -
2017-07-01 13:09:49: createRemote: -
2017-07-01 13:09:49: updateRemote: -
2017-07-01 13:09:49: deleteRemote: -
2017-07-01 13:09:49: folderConflict: -
2017-07-01 13:09:49: noteConflict: -
2017-07-01 13:09:49: Total folders: 2
2017-07-01 13:09:49: Total notes: 0
2017-07-01 13:09:57: Starting synchronization... [1498910997207]
2017-07-01 13:09:57: Sync: deleteRemote: local has been deleted: (Remote 7711fd1e399e4219ba8f5f9e9eeefb16)
2017-07-01 13:09:57: Sync: deleteLocal: remote has been deleted: (Local 68cba53569c84bfbad79eee85402160b)
2017-07-01 13:09:57: Error: Cannot delete the last notebook
Error: Cannot delete the last notebook
at Function._callee$ (/mnt/d/Web/www/joplin/CliClient/app/lib/models/folder.js:59:25)
at tryCatch (/mnt/d/Web/www/joplin/CliClient/node_modules/regenerator-runtime/runtime.js:65:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/mnt/d/Web/www/joplin/CliClient/node_modules/regenerator-runtime/runtime.js:303:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/mnt/d/Web/www/joplin/CliClient/node_modules/regenerator-runtime/runtime.js:117:21)
at step (/mnt/d/Web/www/joplin/CliClient/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
at /mnt/d/Web/www/joplin/CliClient/node_modules/babel-runtime/helpers/asyncToGenerator.js:28:13
at process._tickCallback (internal/process/next_tick.js:109:7)
2017-07-01 13:10:00: Starting synchronization... [1498911000231]
2017-07-01 13:10:00: Sync: deleteLocal: remote has been deleted: (Local 68cba53569c84bfbad79eee85402160b)
2017-07-01 13:10:00: Error: Cannot delete the last notebook
Error: Cannot delete the last notebook
at Function._callee$ (/mnt/d/Web/www/joplin/CliClient/app/lib/models/folder.js:59:25)
at tryCatch (/mnt/d/Web/www/joplin/CliClient/node_modules/regenerator-runtime/runtime.js:65:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/mnt/d/Web/www/joplin/CliClient/node_modules/regenerator-runtime/runtime.js:303:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/mnt/d/Web/www/joplin/CliClient/node_modules/regenerator-runtime/runtime.js:117:21)
at step (/mnt/d/Web/www/joplin/CliClient/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
at /mnt/d/Web/www/joplin/CliClient/node_modules/babel-runtime/helpers/asyncToGenerator.js:28:13
at process._tickCallback (internal/process/next_tick.js:109:7)
2017-07-01 13:10:04: Starting synchronization... [1498911004265]
2017-07-01 13:10:04: Sync: deleteLocal: remote has been deleted: (Local 68cba53569c84bfbad79eee85402160b)
2017-07-01 13:10:04: Error: Cannot delete the last notebook
Error: Cannot delete the last notebook
at Function._callee$ (/mnt/d/Web/www/joplin/CliClient/app/lib/models/folder.js:59:25)
at tryCatch (/mnt/d/Web/www/joplin/CliClient/node_modules/regenerator-runtime/runtime.js:65:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/mnt/d/Web/www/joplin/CliClient/node_modules/regenerator-runtime/runtime.js:303:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/mnt/d/Web/www/joplin/CliClient/node_modules/regenerator-runtime/runtime.js:117:21)
at step (/mnt/d/Web/www/joplin/CliClient/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
at /mnt/d/Web/www/joplin/CliClient/node_modules/babel-runtime/helpers/asyncToGenerator.js:28:13
at process._tickCallback (internal/process/next_tick.js:109:7)

View File

@@ -1,51 +0,0 @@
2017-07-01 13:09:29: Starting joplin-cli 0.8.27...
2017-07-01 13:09:29: Profile directory: /var/www/joplin/CliClient/tests/fuzzing/client1
2017-07-01 13:09:32: Starting joplin-cli 0.8.27...
2017-07-01 13:09:32: Profile directory: /var/www/joplin/CliClient/tests/fuzzing/client1
2017-07-01 13:09:33: Starting joplin-cli 0.8.27...
2017-07-01 13:09:33: Profile directory: /var/www/joplin/CliClient/tests/fuzzing/client1
2017-07-01 13:09:35: Starting joplin-cli 0.8.27...
2017-07-01 13:09:35: Profile directory: /var/www/joplin/CliClient/tests/fuzzing/client1
2017-07-01 13:09:40: Starting joplin-cli 0.8.27...
2017-07-01 13:09:40: Profile directory: /var/www/joplin/CliClient/tests/fuzzing/client1
2017-07-01 13:09:40: mkdir /var/www/joplin/CliClient/tests/fuzzing/sync/.sync
2017-07-01 13:09:40: stat /var/www/joplin/CliClient/tests/fuzzing/sync/7711fd1e399e4219ba8f5f9e9eeefb16.md
2017-07-01 13:09:40: put /var/www/joplin/CliClient/tests/fuzzing/sync/.sync/7711fd1e399e4219ba8f5f9e9eeefb16.md_1498910980567
2017-07-01 13:09:40: setTimestamp /var/www/joplin/CliClient/tests/fuzzing/sync/.sync/7711fd1e399e4219ba8f5f9e9eeefb16.md_1498910980567
2017-07-01 13:09:40: move /var/www/joplin/CliClient/tests/fuzzing/sync/.sync/7711fd1e399e4219ba8f5f9e9eeefb16.md_1498910980567 => /var/www/joplin/CliClient/tests/fuzzing/sync/7711fd1e399e4219ba8f5f9e9eeefb16.md
2017-07-01 13:09:40: list /var/www/joplin/CliClient/tests/fuzzing/sync
2017-07-01 13:09:40: get /var/www/joplin/CliClient/tests/fuzzing/sync/68cba53569c84bfbad79eee85402160b.md
2017-07-01 13:09:43: Starting joplin-cli 0.8.27...
2017-07-01 13:09:43: Profile directory: /var/www/joplin/CliClient/tests/fuzzing/client1
2017-07-01 13:09:44: mkdir /var/www/joplin/CliClient/tests/fuzzing/sync/.sync
2017-07-01 13:09:44: stat /var/www/joplin/CliClient/tests/fuzzing/sync/68cba53569c84bfbad79eee85402160b.md
2017-07-01 13:09:44: put /var/www/joplin/CliClient/tests/fuzzing/sync/.sync/68cba53569c84bfbad79eee85402160b.md_1498910984114
2017-07-01 13:09:44: setTimestamp /var/www/joplin/CliClient/tests/fuzzing/sync/.sync/68cba53569c84bfbad79eee85402160b.md_1498910984114
2017-07-01 13:09:44: move /var/www/joplin/CliClient/tests/fuzzing/sync/.sync/68cba53569c84bfbad79eee85402160b.md_1498910984114 => /var/www/joplin/CliClient/tests/fuzzing/sync/68cba53569c84bfbad79eee85402160b.md
2017-07-01 13:09:44: list /var/www/joplin/CliClient/tests/fuzzing/sync
2017-07-01 13:09:48: Starting joplin-cli 0.8.27...
2017-07-01 13:09:48: Profile directory: /var/www/joplin/CliClient/tests/fuzzing/client1
2017-07-01 13:09:48: mkdir /var/www/joplin/CliClient/tests/fuzzing/sync/.sync
2017-07-01 13:09:49: list /var/www/joplin/CliClient/tests/fuzzing/sync
2017-07-01 13:09:49: get /var/www/joplin/CliClient/tests/fuzzing/sync/7711fd1e399e4219ba8f5f9e9eeefb16.md
2017-07-01 13:09:50: Starting joplin-cli 0.8.27...
2017-07-01 13:09:50: Profile directory: /var/www/joplin/CliClient/tests/fuzzing/client1
2017-07-01 13:09:52: Starting joplin-cli 0.8.27...
2017-07-01 13:09:52: Profile directory: /var/www/joplin/CliClient/tests/fuzzing/client1
2017-07-01 13:09:53: Starting joplin-cli 0.8.27...
2017-07-01 13:09:53: Profile directory: /var/www/joplin/CliClient/tests/fuzzing/client1
2017-07-01 13:09:57: Starting joplin-cli 0.8.27...
2017-07-01 13:09:57: Profile directory: /var/www/joplin/CliClient/tests/fuzzing/client1
2017-07-01 13:09:57: mkdir /var/www/joplin/CliClient/tests/fuzzing/sync/.sync
2017-07-01 13:09:57: delete /var/www/joplin/CliClient/tests/fuzzing/sync/7711fd1e399e4219ba8f5f9e9eeefb16.md
2017-07-01 13:09:57: list /var/www/joplin/CliClient/tests/fuzzing/sync
2017-07-01 13:10:00: Starting joplin-cli 0.8.27...
2017-07-01 13:10:00: Profile directory: /var/www/joplin/CliClient/tests/fuzzing/client1
2017-07-01 13:10:00: mkdir /var/www/joplin/CliClient/tests/fuzzing/sync/.sync
2017-07-01 13:10:00: list /var/www/joplin/CliClient/tests/fuzzing/sync
2017-07-01 13:10:04: Starting joplin-cli 0.8.27...
2017-07-01 13:10:04: Profile directory: /var/www/joplin/CliClient/tests/fuzzing/client1
2017-07-01 13:10:04: mkdir /var/www/joplin/CliClient/tests/fuzzing/sync/.sync
2017-07-01 13:10:04: list /var/www/joplin/CliClient/tests/fuzzing/sync
2017-07-01 13:10:05: Starting joplin-cli 0.8.27...
2017-07-01 13:10:05: Profile directory: /var/www/joplin/CliClient/tests/fuzzing/client1

View File

@@ -1,7 +1,7 @@
import fs from 'fs'; import fs from 'fs-extra';
import fse from 'fs-extra';
import { promiseChain } from 'lib/promise-utils.js'; import { promiseChain } from 'lib/promise-utils.js';
import moment from 'moment'; import moment from 'moment';
import { time } from 'lib/time-utils.js';
class FileApiDriverLocal { class FileApiDriverLocal {
@@ -53,38 +53,21 @@ class FileApiDriverLocal {
}); });
} }
list(path, options) { async list(path, options) {
return new Promise((resolve, reject) => { let items = await fs.readdir(path);
fs.readdir(path, (error, items) => { let output = [];
if (error) {
reject(error);
return;
}
let chain = [];
for (let i = 0; i < items.length; i++) { for (let i = 0; i < items.length; i++) {
chain.push((output) => { let stat = await this.stat(path + '/' + items[i]);
if (!output) output = []; if (!stat) continue; // Has been deleted between the readdir() call and now
return this.stat(path + '/' + items[i]).then((stat) => {
stat.path = items[i]; stat.path = items[i];
output.push(stat); output.push(stat);
return output;
});
});
} }
return promiseChain(chain).then((results) => { return {
if (!results) results = []; items: output,
resolve({
items: results,
hasMore: false, hasMore: false,
context: null, context: null,
}); };
}).catch((error) => {
reject(error);
});
});
});
} }
get(path) { get(path) {
@@ -155,8 +138,26 @@ class FileApiDriverLocal {
}); });
} }
move(oldPath, newPath) { async move(oldPath, newPath) {
return fse.move(oldPath, newPath, { overwrite: true }); let lastError = null;
for (let i = 0; i < 5; i++) {
try {
let output = await fs.move(oldPath, newPath, { overwrite: true });
return output;
} catch (error) {
lastError = error;
// Normally cannot happen with the `overwrite` flag but sometime it still does.
// In this case, retry.
if (error.code == 'EEXIST') {
await time.sleep(1);
continue;
}
throw error;
}
}
throw lastError;
} }
format() { format() {

View File

@@ -43,7 +43,10 @@ class BaseItem extends BaseModel {
} }
static loadItemByPath(path) { static loadItemByPath(path) {
let id = this.pathToId(path); return this.loadItemById(this.pathToId(path));
}
static loadItemById(id) {
return Note.load(id).then((item) => { return Note.load(id).then((item) => {
if (item) return item; if (item) return item;
return Folder.load(id); return Folder.load(id);

View File

@@ -78,6 +78,17 @@ class Synchronizer {
return this.syncDirName_; return this.syncDirName_;
} }
randomFailure(options, name) {
if (!options.randomFailures) return false;
if (this.randomFailureChoice_ == name) {
options.onMessage('Random failure: ' + name);
return true;
}
return false;
}
async start(options = null) { async start(options = null) {
if (!options) options = {}; if (!options) options = {};
if (!options.onProgress) options.onProgress = function(o) {}; if (!options.onProgress) options.onProgress = function(o) {};
@@ -87,6 +98,8 @@ class Synchronizer {
return; return;
} }
this.randomFailureChoice_ = Math.floor(Math.random() * 5);
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
// First, find all the items that have been changed since the // First, find all the items that have been changed since the
// last sync and apply the changes to remote. // last sync and apply the changes to remote.
@@ -172,6 +185,8 @@ class Synchronizer {
await this.api().setTimestamp(tempPath, local.updated_time); await this.api().setTimestamp(tempPath, local.updated_time);
await this.api().move(tempPath, path); await this.api().move(tempPath, path);
if (this.randomFailure(options, 0)) return;
await ItemClass.save({ id: local.id, sync_time: time.unixMs(), type_: local.type_ }, { autoTimestamp: false }); await ItemClass.save({ id: local.id, sync_time: time.unixMs(), type_: local.type_ }, { autoTimestamp: false });
} else if (action == 'folderConflict') { } else if (action == 'folderConflict') {
@@ -195,6 +210,8 @@ class Synchronizer {
conflictedNote.is_conflict = 1; conflictedNote.is_conflict = 1;
await Note.save(conflictedNote, { autoTimestamp: false }); await Note.save(conflictedNote, { autoTimestamp: false });
if (this.randomFailure(options, 1)) return;
if (remote) { if (remote) {
let remoteContent = await this.api().get(path); let remoteContent = await this.api().get(path);
local = BaseItem.unserialize(remoteContent); local = BaseItem.unserialize(remoteContent);
@@ -227,6 +244,7 @@ class Synchronizer {
let path = BaseItem.systemPath(item.item_id) let path = BaseItem.systemPath(item.item_id)
this.logSyncOperation('deleteRemote', null, { id: item.item_id }, 'local has been deleted'); this.logSyncOperation('deleteRemote', null, { id: item.item_id }, 'local has been deleted');
await this.api().delete(path); await this.api().delete(path);
if (this.randomFailure(options, 2)) return;
await BaseModel.remoteDeletedItem(item.item_id); await BaseModel.remoteDeletedItem(item.item_id);
report['deleteRemote']++; report['deleteRemote']++;
@@ -289,6 +307,8 @@ class Synchronizer {
await ItemClass.save(newContent, options); await ItemClass.save(newContent, options);
} catch (error) { } catch (error) {
if (this.randomFailure(options, 3)) return;
if (error.code == 'duplicateTitle') { if (error.code == 'duplicateTitle') {
newContent.title = newContent.title + '-' + newContent.created_time + '-' + (Math.floor(Math.random() * 1000)); newContent.title = newContent.title + '-' + newContent.created_time + '-' + (Math.floor(Math.random() * 1000));
newContent.updated_time = newContent.sync_time + 2; newContent.updated_time = newContent.sync_time + 2;
@@ -317,6 +337,8 @@ class Synchronizer {
// means the item has been deleted. // means the item has been deleted.
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
if (this.randomFailure(options, 4)) return;
let items = await BaseItem.syncedItems(); let items = await BaseItem.syncedItems();
for (let i = 0; i < items.length; i++) { for (let i = 0; i < items.length; i++) {
let item = items[i]; let item = items[i];