From 96b36cd3d5247ee50e5c07f421d2d031a3ced905 Mon Sep 17 00:00:00 2001
From: Christian Paul <christianp@matrix.org>
Date: Fri, 8 Jan 2021 13:10:27 +0100
Subject: [PATCH] Fix counting of entries

---
 src/db/roomstore.ts | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/db/roomstore.ts b/src/db/roomstore.ts
index 8a59650..4a90555 100644
--- a/src/db/roomstore.ts
+++ b/src/db/roomstore.ts
@@ -104,7 +104,9 @@ export class DbRoomStore {
      * @returns {number} The amount of room pairs as an integer
      */
     public async countEntries() {
-        const row = (await this.db.Get("SELECT COUNT(*) FROM room_entries WHERE matrix_id IS NOT NULL AND remote_id IS NOT NULL")) || {};
+        const row = (await this.db.Get("SELECT COUNT(*) AS count FROM room_entries WHERE matrix_id IS NOT NULL AND remote_id IS NOT NULL")) || {};
+
+        console.warn('abc', JSON.stringify(row), typeof row.count);
 
         if (typeof row.count !== "number") {
             log.error("Failed to count room entries");
-- 
GitLab