From e9b672a34e08bce9d12b2a2454c19fde6e52036e Mon Sep 17 00:00:00 2001
From: S7evinK <2353100+S7evinK@users.noreply.github.com>
Date: Wed, 16 Feb 2022 17:56:45 +0100
Subject: [PATCH] Make "Device list doesn't change if remote server is down"
 pass (#2190)

---
 keyserver/internal/internal.go | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/keyserver/internal/internal.go b/keyserver/internal/internal.go
index 2536c1f76..ffbcac94b 100644
--- a/keyserver/internal/internal.go
+++ b/keyserver/internal/internal.go
@@ -513,6 +513,11 @@ func (a *KeyInternalAPI) queryRemoteKeysOnServer(
 		// drop the error as it's already a failure at this point
 		_ = a.populateResponseWithDeviceKeysFromDatabase(ctx, res, userID, dkeys)
 	}
+
+	// Sytest expects no failures, if we still could retrieve keys, e.g. from local cache
+	if len(res.DeviceKeys) > 0 {
+		delete(res.Failures, serverName)
+	}
 	respMu.Unlock()
 
 }