From e59d4908590387f8f9400c16f74145ef4aa465f7 Mon Sep 17 00:00:00 2001 From: Will Hunt <will@half-shot.uk> Date: Mon, 28 Jan 2019 00:33:20 +0000 Subject: [PATCH] Don't cache stuff we didn't find --- 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 303a11a..0e4d365 100644 --- a/src/db/roomstore.ts +++ b/src/db/roomstore.ts @@ -175,7 +175,9 @@ export class DbRoomStore { remote: remoteId ? new RemoteStoreRoom(remoteId, row as any) : null, }); } - this.entriesMatrixIdCache.set(matrixId, {e: res, ts: Date.now()}); + if (res.length > 0) { + this.entriesMatrixIdCache.set(matrixId, {e: res, ts: Date.now()}); + } return res; } -- GitLab