From dc0b8bcb6be39cffc436db901879fe3d28fa8840 Mon Sep 17 00:00:00 2001 From: Lauryn Menard Date: Mon, 4 Dec 2023 19:37:49 +0100 Subject: [PATCH] analytics: Update query for remote_push_devices in remote activity. Updates query to count the distinct pairs of user_id and user_uuid on the RemotePushDeviceToken table. --- analytics/views/remote_activity.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/analytics/views/remote_activity.py b/analytics/views/remote_activity.py index b53509bb02..b5b389de98 100644 --- a/analytics/views/remote_activity.py +++ b/analytics/views/remote_activity.py @@ -41,7 +41,10 @@ def get_remote_server_activity(request: HttpRequest) -> HttpResponse: group by server_id ), remote_push_devices as ( - select server_id, count(distinct(user_id)) as push_user_count from zilencer_remotepushdevicetoken + select + server_id, + count(distinct(user_id, user_uuid)) as push_user_count + from zilencer_remotepushdevicetoken group by server_id ) select