-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: prevent hanging when calling get_groups
with prefix
and small page_size
#326
Conversation
Is this the rumored bug in Connect? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there any unit tests that already verify this functionality?
Co-authored-by: Neal Richardson <neal.p.richardson@gmail.com>
@tdstein I mean, it's an odd behavior, but the
So when calling Aside: the I found Cole's original issue about this: https://github.com/rstudio/connect/issues/17543. Two notes on that: it (1) requests that the API return an error with The Cookbook docs on offset pagination are here. They recommend paging through results until you reach an empty page, which suggests that the behavior of the Another option for this PR is to have the [edit] another subtle bug with v1/groups is that the docs say that order is always based on similarity, but specifying page size does not just truncate the list, it seems to include the first list and then some number of results from the end. that's getting a connect bug too. |
Intent
get_groups(client, prefix = "prefix")
would fail when thepage_size
required pagination — it would hang forever.Fixes #319
Approach
v1/groups
API only ever returns the first page of results when usingprefix
.v1/users
returns no results when a subsequent page of aprefix
request is called,v1/groups
always returns the first page, which causesconnectapi
to just page eternally.Checklist
NEWS.md
(referencing the connected issue if necessary)?