From 86c5dd6494a0878ab0f531318d87bc7e1e1a0430 Mon Sep 17 00:00:00 2001
From: zadam <zadam.apps@gmail.com>
Date: Tue, 19 Nov 2019 19:02:16 +0100
Subject: [PATCH 1/2] fix recent changes, closes #713

---
 package-lock.json                | 2 +-
 src/routes/api/recent_changes.js | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/package-lock.json b/package-lock.json
index 63c583348..00e79a4a2 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
 {
   "name": "trilium",
-  "version": "0.36.5",
+  "version": "0.37.2",
   "lockfileVersion": 1,
   "requires": true,
   "dependencies": {
diff --git a/src/routes/api/recent_changes.js b/src/routes/api/recent_changes.js
index 4ba99886f..14a7fcf8d 100644
--- a/src/routes/api/recent_changes.js
+++ b/src/routes/api/recent_changes.js
@@ -17,8 +17,8 @@ async function getRecentChanges() {
             FROM 
                 note_revisions
                 JOIN notes USING(noteId)
-            ORDER BY 
-                utcDateCreated DESC
+            ORDER BY
+                note_revisions.utcDateCreated DESC
             LIMIT 1000
         )
         UNION ALL SELECT * FROM (

From 61e8cbbcbadc7392c4a56c63a8ae58e405b95db8 Mon Sep 17 00:00:00 2001
From: zadam <zadam.apps@gmail.com>
Date: Tue, 19 Nov 2019 19:07:14 +0100
Subject: [PATCH 2/2] add log for content hash failures

---
 src/services/content_hash.js | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/services/content_hash.js b/src/services/content_hash.js
index 5384a3492..c0c0f647d 100644
--- a/src/services/content_hash.js
+++ b/src/services/content_hash.js
@@ -56,6 +56,8 @@ async function checkContentHashes(otherHashes) {
         if (hashes[key] !== otherHashes[key]) {
             allChecksPassed = false;
 
+            log.info(`Content hash check for ${key} FAILED. Local is ${hashes[key]}, remote is ${otherHashes[key]}`);
+
             if (key !== 'recent_notes') {
                 // let's not get alarmed about recent notes which get updated often and can cause failures in race conditions
                 ws.sendMessageToAllClients({type: 'sync-hash-check-failed'});