From 39936972f77a7f3817981e232f52cfbfd78550d2 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Sun, 17 Dec 2023 09:28:27 -0800 Subject: [PATCH] zilencer: Fix can_push logging bug with system bot realms. We could be incorrectly logging the can_push value associated with the system bot realm when only a single human realm existed on a server. --- zilencer/views.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/zilencer/views.py b/zilencer/views.py index 62e34cf08f..77abaf37e0 100644 --- a/zilencer/views.py +++ b/zilencer/views.py @@ -1072,9 +1072,12 @@ def remote_server_post_analytics( for remote_realm in remote_realms: uuid = str(remote_realm.uuid) status = get_push_status_for_remote_request(server, remote_realm) - if remote_human_realm_count == 1: # nocoverage + if remote_realm.is_system_bot_realm: + # Ignore system bot realms for computing log_data + pass + elif remote_human_realm_count == 1: # nocoverage log_data["extra"] = f"[can_push={status.can_push}/{status.message}]" - elif not remote_realm.is_system_bot_realm: + else: can_push_values.add(status.can_push) remote_realm_dict[uuid] = { "can_push": status.can_push,