Repository navigation
Handle a missing total_results in all_results - #80
Merged
Merged
Conversation
houndci-bot
reviewed
Nov 21, 2026
|
|
||
| break if limit && results.size >= limit | ||
| break if next_offset > results.total_results | ||
| # without a known total, a short page means there is nothing more to fetch |
Collaborator
There was a problem hiding this comment.
Metrics/LineLength: Line is too long. [82/80]
| @results.total_results = nil | ||
| results = @test_model.all_results(@profile) | ||
| assert_equal @results.to_a, results.to_a | ||
| assert_received(Request::Data, :new) { |e| e.once } |
Collaborator
There was a problem hiding this comment.
Style/SymbolProc: Pass &:once as an argument to assert_received instead of a block.
|
Caution Review failedThe pull request is closed.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
When the response has no `totalResults`, `next_offset > results.total_results` raised `ArgumentError` (comparison of `Integer` with `nil`). Without a known total, stop once a page comes back shorter than requested. Assisted-by: Claude:claude-opus-5-5
Sija
force-pushed
the
fix/all-results-missing-total
branch
from
November 21, 2026 22:15
5720248 to
9e0a934
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When the response has no
totalResults, the stop check compared anIntegerwithniland raised. Without a known total, paging now stops at the first page shorter than requested.Evidence
127 tests, 225 assertions, 0 failures, 0 errors(one request, one page returned)Merge Danger
Door: two-way
Blast Radius: small
Relies on the API returning full pages until the last one when the total is unknown.
🤖 Generated with Claude Code