fix: Keep pagination iterators advancing past fully-filtered pages#964
Open
vdusek wants to merge 4 commits into
Open
fix: Keep pagination iterators advancing past fully-filtered pages#964vdusek wants to merge 4 commits into
vdusek wants to merge 4 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #964 +/- ##
==========================================
- Coverage 94.64% 94.62% -0.02%
==========================================
Files 58 58
Lines 5263 5246 -17
==========================================
- Hits 4981 4964 -17
Misses 282 282
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
vdusek
marked this pull request as ready for review
July 21, 2026 08:07
Pijukatel
approved these changes
Jul 22, 2026
Pijukatel
left a comment
Contributor
There was a problem hiding this comment.
Can you please check the JS implementation as well
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.
The offset- and cursor-based pagination iterators stopped as soon as a page's
itemslist came back empty. But under dataset filters (clean,skip_empty,skip_hidden), the API can scan a full chunk (up to 1000 items) while returning none —items=[]withx-apify-pagination-count: 1000. The iterators broke on that page and silently never yielded any item behind it, even though the offset bookkeeping (max(count, len(items))) had already advanced past the scanned rows.Now all four iterators (offset + cursor, sync + async) terminate on the number of items scanned rather than returned: they keep advancing the offset/cursor across fully-filtered pages and stop only when a page scans nothing. The
limitandcursor is Nonechecks are unchanged. Behavior is identical for every response without a divergentcount(collection endpoints,ListOfRequests).Added a regression test for each of the four iterators.
Related to https://github.com/apify/apify-core/issues/27324.
✍️ Drafted by Claude Code