It appears that the endpoint /rest/api/2/user/search?query= has an unstable ordering to it.
I set up 3 users, all with displayName containing "tester", and when I then run
/rest/api/2/user/search?query=tester&startAt=0&maxResults=3
I get 2 possible orderings. One is way more likely, and the other happens about 1 in 5-10 times. It's easily reproducible in Postman or similar.
This is breaking any kind of pagination, as if you are actually cycling through pages of results and some would be ordered differently, you entire result set won't have all results in it.
I reproduced this on two different Cloud instances, but it also seems to be a bit dependent on the search & users. For example on one instance we have multiple users for the "Tempo" plugin (that have Tempo in their displayname) and also a user with "tester" in the display name. Using the search term "tempo" seems to have stable ordering, but "te" has the same varying ordering as described above.
Now I guess I can reduce the likelyhood of this problem by using a large page size (and thus hoping paging will never happen), but it seems like there is some kind of bug here?
Has anybody else come across this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.