User search problems in /user request and response #189
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
KittenSquad/glewlwyd#189
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
You did say you were all ears...
Describe the issue
On the admin web interface User List, entering a string in the search box and clicking the search button has no effect (just returns the current page as before search). There seem to be two issues:
Expected behavior
Only users whose names/usernames contain the submitted string (case insensitive match) should be returned, starting with offset 0. Forward and back buttons should maintain the pattern parameter while changing offset to page through the search results.
System (please complete the following information):
Docker :src build from 02/10/2021 running on AWS Linux2.
Hello @ajl199 ,
I am!
I can reproduce your issue but I'd like to make sure we're on the same page.
In your request example: https://example.com/api/user?offset=40&limit=20&pattern=Adrian , the option
offset=40means that you are make in search in the 3 page (using the>>).There, if you make a search, the option
offset=40remains, which leads to an empty result if the result has less than 40 entries.Does my description fit your issue or am I missing something else?
Yes, that's right, that's one of the two problems. Equally, even if there were enough results for the user to be on a valid page, normal expectation would be to start on the first page of the returned results.
The other problem is that the results returned don't seem to have been filtered by the search string: if I search for "zzzzzzzzzzz", the browser console shows a 200 response with a JSON body containing 20 real users, who obviously don't have that in their names.
That one I can't reproduce yet.
You said earlier you use the database backend with a mysql database right?
Yes, that's right. Interesting you can't reproduce it - maybe it is just me! I've attached a somewhat redacted composite screenshot to show what's happening client-side.
@ajl199 , I fixed the offset issue in
github.com/babelouest/glewlwyd@f52eeca96fbut the invalid result remains though.Although since I'm not able to reproduce it in my tests I suggest you reopen a new issue for this one only and we can start again from there.