-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
Status: TriageThis is being looked at and prioritizedThis is being looked at and prioritizedType: BugSomething isn't working as documentedSomething isn't working as documented
Description
What happened?
I was using the Octokit gem to iterate through issues with a given block:
client.paginate('/repos/rails/rails/issues') do |batch|
puts "Batch from #{batch.first.number} to #{batch.last.number}"
end
This was always yielding the same batch to the block. I then investigated the source code and this indeed the case:
octokit.rb/lib/octokit/connection.rb
Line 90 in ea3413c
| yield(data, @last_response) |
data is never modified, yet always yielded to the block. It will always correspond to the data from the initial request.
Assuming that this isn't intentional, may I work on a fix for it?
PS: The documentation for this also looks incorrect or outdated https://docs.github.com/en/rest/guides/scripting-with-the-rest-api-and-ruby?apiVersion=2022-11-28#making-paginated-requests
Versions
Octokit gem 10.0.0
Ruby version 3.3.4
Relevant log output
Code of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
Status: TriageThis is being looked at and prioritizedThis is being looked at and prioritizedType: BugSomething isn't working as documentedSomething isn't working as documented
Type
Projects
Status
🆕 Triage