connectapi icon indicating copy to clipboard operation
connectapi copied to clipboard

Paginated users requests makes one too many requests

Open nealrichardson opened this issue 10 months ago • 0 comments

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.

nealrichardson avatar Apr 05 '24 14:04 nealrichardson