connectapi
connectapi copied to clipboard
Paginated users requests makes one too many requests
The logic in the offset paginator is that it keeps requesting the next page until you get 0 results. This means that even if all results fit onto one page, you make two HTTP requests.
The paginated responses include a "total" value, so we can stop when we've accumulated that many results. Or, you could quit if the number of results you got back is less than the page size--that would overrequest in the case where the total number is an even multiple of the page size, but otherwise not.
This isn't a bug, the results are correct, it just makes it a little slower to get all users because you have an extra request to wait on.