summary refs log tree commit diff
path: root/synapse/storage/databases/main
diff options
context:
space:
mode:
authorreivilibre <oliverw@matrix.org>2022-12-07 11:19:43 +0000
committerGitHub <noreply@github.com>2022-12-07 11:19:43 +0000
commitcf1059d045640485a5a0b1e3d945b796b0e6f228 (patch)
treee0e408463d49bcc58865127b354aa826c2a701e6 /synapse/storage/databases/main
parentFaster remote room joins: unblock tasks waiting for full room state when the ... (diff)
downloadsynapse-cf1059d045640485a5a0b1e3d945b796b0e6f228.tar.xz
Fix a long-standing bug where the user directory would return 1 more row than requested. (#14631)
Diffstat (limited to 'synapse/storage/databases/main')
-rw-r--r--synapse/storage/databases/main/user_directory.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/synapse/storage/databases/main/user_directory.py b/synapse/storage/databases/main/user_directory.py
index 044435deab..af9952f513 100644
--- a/synapse/storage/databases/main/user_directory.py
+++ b/synapse/storage/databases/main/user_directory.py
@@ -886,7 +886,7 @@ class UserDirectoryStore(UserDirectoryBackgroundUpdateStore):
 
         limited = len(results) > limit
 
-        return {"limited": limited, "results": results}
+        return {"limited": limited, "results": results[0:limit]}
 
 
 def _parse_query_sqlite(search_term: str) -> str: