summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2017-03-06 11:10:10 +0000
committerErik Johnston <erik@matrix.org>2017-03-06 11:10:14 +0000
commitac5491f56308405890530ae09ac6ffcf93ad48b7 (patch)
tree8c8644b20ab01edc8b8ec655d8687373e5f14de0 /synapse
parentMerge pull request #1964 from matrix-org/erikj/device_list_update_fix (diff)
downloadsynapse-ac5491f56308405890530ae09ac6ffcf93ad48b7.tar.xz
Select distinct devices from DB
Otherwise we might pull out tonnes of duplicate user_ids and this can
make synapse sad.
Diffstat (limited to 'synapse')
-rw-r--r--synapse/storage/devices.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/synapse/storage/devices.py b/synapse/storage/devices.py
index 81c43d31f6..bd56ba2515 100644
--- a/synapse/storage/devices.py
+++ b/synapse/storage/devices.py
@@ -508,7 +508,7 @@ class DeviceStore(SQLBaseStore):
             defer.returnValue(set(changed))
 
         sql = """
-            SELECT user_id FROM device_lists_stream WHERE stream_id > ?
+            SELECT DISTINCT user_id FROM device_lists_stream WHERE stream_id > ?
         """
         rows = yield self._execute("get_user_whose_devices_changed", None, sql, from_key)
         defer.returnValue(set(row[0] for row in rows))