Allow setting page size separately from limit in `page_cursor()`

Open
#506 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
r
Domain
api

Research direction

Start in R/connect.R around line 725, where page_cursor() currently derives page size and total results from limit. Determine an interface that permits those values to differ, then verify that the existing limit behaviors remain intact and that separate page-size and total-result values work as intended.

Written by the indexing model from the issue text.

Description

page_cursor() currently has strange behavior where the limit argument controls both the total number of results and the page size, but in different ways.

https://github.com/posit-dev/connectapi/blob/1bfa7ea314c3828bc9d4b85cac54c2690be730c9/R/connect.R#L725

  • If limit = Inf, page size is 500 and you get all results
  • If limit > 500 & limit < Inf, page size is 500 and you get limit results
  • If limit > 0 & limit <= 500, page size is limit and you get limit results

There is no way to, say, set the page size and limit to different values unless limit > 500. We should expose more flexibility here.

Dominant language
R
Stars
54
Forks
27
Avg merge
1d 3m
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from posit-dev/connectapi

All issues in posit-dev/connectapi

Similar issues

More R issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.