From 7f7028873cb8982cc1147eb627a519ecbb38a36a Mon Sep 17 00:00:00 2001 From: azivner Date: Sat, 30 Dec 2017 19:38:30 -0500 Subject: [PATCH] fixed synced issue when changing protected status of note history --- services/sync_update.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/sync_update.js b/services/sync_update.js index 2201564ac..ddd38fb90 100644 --- a/services/sync_update.js +++ b/services/sync_update.js @@ -40,7 +40,9 @@ async function updateNoteHistory(entity, sourceId) { const orig = await sql.getFirstOrNull("SELECT * FROM notes_history WHERE note_history_id = ?", [entity.note_history_id]); await sql.doInTransaction(async () => { - if (orig === null || orig.date_modified_to < entity.date_modified_to) { + // we update note history even if date modified to is the same because the only thing which might have changed + // is the protected status (and correnspondingly note_title and note_text) which doesn't affect the date_modified_to + if (orig === null || orig.date_modified_to <= entity.date_modified_to) { await sql.replace('notes_history', entity); await sync_table.addNoteHistorySync(entity.note_history_id, sourceId);