Fix user pagination bug
GET /api/pleroma/admin/users
should return same count for every page but it returns wrong numbers when I try to retrieve data for the latest pages:
This query returns correct data
curl 'https://bikeshed.party/api/pleroma/admin/users?page=1971&filters=' \
-H 'Connection: keep-alive' \
-H 'Accept: application/json, text/plain, */*' \
-H 'Authorization: Bearer REDACTED' \
-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.122 Safari/537.36' \
-H 'Origin: http://localhost:9527' \
-H 'Sec-Fetch-Site: cross-site' \
-H 'Sec-Fetch-Mode: cors' \
-H 'Sec-Fetch-Dest: empty' \
-H 'Referer: http://localhost:9527/' \
-H 'Accept-Language: ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7' \
--compressed
{"count":98609,"page_size":50,"users":[{...}]}
And this is the query for the next page:
curl 'https://bikeshed.party/api/pleroma/admin/users?page=1972&filters=' \
-H 'Connection: keep-alive' \
-H 'Accept: application/json, text/plain, */*' \
-H 'Authorization: Bearer REDACTED' \
-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.122 Safari/537.36' \
-H 'Origin: http://localhost:9527' \
-H 'Sec-Fetch-Site: cross-site' \
-H 'Sec-Fetch-Mode: cors' \
-H 'Sec-Fetch-Dest: empty' \
-H 'Referer: http://localhost:9527/' \
-H 'Accept-Language: ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7' \
--compressed
{"count":43,"page_size":50,"users":[{...}]}
Note that the count is 43, while it should be 98k.
And if I query for the last page I get this:
{"count":1,"page_size":50,"users":[{"avatar":"https://bikeshed.party/proxy/9NiY6BsiXSVavEzpQ3UCH2TwUFA/aHR0cHM6Ly90dWJlLmtkeS5jaC9zdGF0aWMvdGh1bWJuYWlscy8xMWJlNGI4My02MWUxLTQyMWItOGEzOC00MTdmNzc1YWE5NzMuanBn/11be4b83-61e1-421b-8a38-417f775aa973.jpg","confirmation_pending":false,"deactivated":false,"display_name":"Elections européennes : rappel des règles - Le billet de Nicole Ferroni","id":"9jB8dv40hMT0yHlcS8","local":false,"nickname":null,"roles":{"admin":false,"moderator":false},"tags":[]}]}