summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-12-03 11:56:49 +0000
committerErik Johnston <erik@matrix.org>2014-12-03 11:56:49 +0000
commit6941a1971548ea8ba37130deeffe2a2e2cd88085 (patch)
tree9b6947d42c18e4a7ccb9c4e34525faa8e073cf76 /synapse/storage
parentBegin fleshing out a new Event object (diff)
parentFix bug where did not always resolve all the deferreds in _attempt_new_transa... (diff)
downloadsynapse-6941a1971548ea8ba37130deeffe2a2e2cd88085.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into events_refactor
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/roommember.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/synapse/storage/roommember.py b/synapse/storage/roommember.py
index c37df59d45..05b275663e 100644
--- a/synapse/storage/roommember.py
+++ b/synapse/storage/roommember.py
@@ -218,7 +218,9 @@ class RoomMemberStore(SQLBaseStore):
             "ON m.event_id = c.event_id "
             "WHERE m.membership = 'join' "
             "AND (%(clause)s) "
-            "GROUP BY m.room_id HAVING COUNT(m.room_id) = ?"
+            # TODO(paul): We've got duplicate rows in the database somewhere
+            #   so we have to DISTINCT m.user_id here
+            "GROUP BY m.room_id HAVING COUNT(DISTINCT m.user_id) = ?"
         ) % {"clause": user_list_clause}
 
         args = list(user_id_list)