Visitar URL original
listPullRequests({ state: 'all' }) does not return all pull requests. · Issue #593 · github-tools/github · GitHub
The Wayback Machine - https://web.archive.org/web/20200920060812/https://github.com/github-tools/github/issues/593
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

listPullRequests({ state: 'all' }) does not return all pull requests. #593

Open
sustained opened this issue Oct 7, 2019 · 3 comments
Open

listPullRequests({ state: 'all' }) does not return all pull requests. #593

sustained opened this issue Oct 7, 2019 · 3 comments

Comments

@sustained
Copy link

@sustained sustained commented Oct 7, 2019

Reproduction

const assert = require('assert')
const Github = require('github-api')

const github = new Github()

;(async () => {
  const repo = github.getRepo('vuejs', 'rfcs')

  const all = (await repo.listPullRequests({ state: 'all' })).data.length
  const open = (await repo.listPullRequests({ state: 'open' })).data.length
  const closed = (await repo.listPullRequests({ state: 'closed' })).data.length

  assert.equal(all, open + closed)
})()

See

https://github.com/vuejs/rfcs/pulls

@sustained
Copy link
Author

@sustained sustained commented Oct 7, 2019

Ah. It's relating to all these pagination issues.

Workaround

  const all = await repo._requestAllPages(
    `/repos/${repo.__fullname}/pulls?state=all`,
  )
@j-rewerts
Copy link
Member

@j-rewerts j-rewerts commented Oct 8, 2019

Is this related to pagination? This just seems like an options-passing issue.

@sustained
Copy link
Author

@sustained sustained commented Oct 8, 2019

I don't know.

But I found the _requestAllPages workaround in another issue relating to pagination.

So presumed it was that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.