This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Search in columns 'name' and 'displayname' in the admin users endpoint #7377
Search in columns 'name' and 'displayname' in the admin users endpoint #7377
Changes from 1 commit
bed8190
3970339
06004a5
2468621
e699f7e
ae5477c
42bcd0b
7ea27cd
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mm, actually I talked to some of the other devs and we agree that changing the behaviour of
user_id
from under users isn't the best course of action. Additionally, if someone would like to only filter byuser_id
and notdisplayname
, they'd be unable to do so anymore.Can we add a new field called
user_id_or_displayname
which searches both fields? I agree that it's not the prettiest name but it should do what you desire without implementing complex OR functionality for all fields in the API.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just
name
to search in both? Anyway a problem with searching in theuser_id
still is that it also searches inside the domain part. So if you domain has some very common character sequence you will get a lot of users.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine. I'm a little weary that we call the column
name
in theusers
table in Synapse which holds User IDs, but that's just an internal detail. If the docs describe it as both user IDs and displaynames then it should be fine.You could add another field just for displayname, or are you proposing one for
localpart
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My personal opinion is that we would not add separate search fields in the admin UI, so a single query parameter is enough for us.
Searching in both,
user_id
anddisplayname
at the same time just gives you a few more results than expected in some cases. It will definitely never be precise enough to select exactly everyone with a specific surname.For the
user_id
I found a solution to only search inside thelocalpart
, see updated PR.