From bff54fbfdbd35fd66741f0f401963d534052e2da Mon Sep 17 00:00:00 2001 From: BlackDex Date: Fri, 31 Mar 2023 18:01:55 +0200 Subject: [PATCH] Fix sending out multiple websocket notifications For some reason I encountered a strange bug which resulted in sending out multiple websocket notifications for the exact same user. Added a `distinct()` for the query to filter out multiple uuid's. --- src/db/models/organization.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/db/models/organization.rs b/src/db/models/organization.rs index 6010c207..e0b92239 100644 --- a/src/db/models/organization.rs +++ b/src/db/models/organization.rs @@ -715,6 +715,7 @@ impl UserOrganization { ) ) .select(users_organizations::all_columns) + .distinct() .load::(conn).expect("Error loading user organizations").from_db() }} }