Skip to content
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

gh 1.4.0 gh_next() returns the same object #181

Closed
carlosparadis opened this issue May 31, 2023 · 2 comments
Closed

gh 1.4.0 gh_next() returns the same object #181

carlosparadis opened this issue May 31, 2023 · 2 comments
Labels
bug an unexpected problem or unintended behavior

Comments

@carlosparadis
Copy link

carlosparadis commented May 31, 2023

I came across this issue when re-executing source code in a new machine and noticing my

while(!is.null(res){
    res <- gh::gh_next(res)
}

were returning the same page instead of the next page on the new machine, but not in the older machine.

Older machine:

  • R 3.6.1
  • OS X 10.15.7
  • gh 1.2.0

New Machine (issue is here):

  • R 4.2.1
  • OS X 12.6.6
  • gh 1.4.0

After re-installing on the New Machine gh 1.2.0, it worked again.

Minimal Reproducible Example on New Machine

require(devtools)
devtools::install_version("gh", version = "1.4.0", repos = "http://cran.us.r-project.org")
require(gh)

res <- gh::gh("GET /repos/{owner}/{repo}/issues/events",
              owner="Copilot-Language",
              repo="copilot",
              type="IssuesEvent",
              page=1,
              per_page=100,
              .token=token)

res[[1]]$id # 9297015929

res <- gh::gh_next(res)

res[[1]]$id # 9297015929

devtools::install_version("gh", version = "1.2.0", repos = "http://cran.us.r-project.org")
require(gh)

res <- gh::gh("GET /repos/{owner}/{repo}/issues/events",
              owner="Copilot-Language",
              repo="copilot",
              type="IssuesEvent",
              page=1,
              per_page=100,
              .token=token)

res[[1]]$id # 9297015929

res <- gh::gh_next(res)

res[[1]]$id # 8860246024

I did not get any errors or warnings when executing the MRE.

@gaborcsardi gaborcsardi added the bug an unexpected problem or unintended behavior label May 31, 2023
@gaborcsardi
Copy link
Member

gaborcsardi commented Mar 28, 2024

res <- gh::gh(
  "GET /repos/{owner}/{repo}/issues/events",
  owner = "Copilot-Language",
  repo = "copilot",
  type = "IssuesEvent",
  page = 1,
  per_page = 100
)

length(res)
res[[1]]$id

res2 <- gh::gh_next(res)
length(res2)

res2[[1]]$id

identical(res[[1]], res2[[1]])

@carlosparadis
Copy link
Author

@gaborcsardi Thank you for addressing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants