This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
user-directory API wrong limit and limited (off by 1) #10840
Labels
P4
(OBSOLETE: use S- labels.) Okay backlog: will not schedule, will accept patches
S-Tolerable
Minor significance, cosmetic issues, low or no impact to users.
T-Defect
Bugs, crashes, hangs, security vulnerabilities, or other reported issues.
Description
https://matrix.org/docs/spec/client_server/latest#user-directory
The
limited
response attribut is wrongly reportedIf I search for a term with a limit of : 50 this query can return 2 elements and the result is not truncated :
"limited": false
: okBut if I limit the search to 1 element. The result show me the two elements and respond with
"limited": true
which is twice wrong as the result is complete and I have asked to limit the response to 1...If I don't specify
limit
in query I can get 11 response but the doc says :If I use ask to limit to more than 50 the result is truncated at 51 elements.
This hard limit (not configurable)
synapse/synapse/rest/client/user_directory.py
Line 67 in bfb4b85
is not documented in the api (and off by 1)
https://matrix.org/docs/spec/client_server/latest#user-directory
return 2 result : ok ,
limited : false
: okthen limit by 1 in query:
"limited": true
.. but this is wrongVersion information
This was discover in a old version but the source code of the directory_search and rest api endpoint wich limit to 50(51) does not have change a lot since
Discoverd in our homeserver
Ubuntu
The text was updated successfully, but these errors were encountered: