Skip to content

fix: Keep pagination iterators advancing past fully-filtered pages#964

Open
vdusek wants to merge 4 commits into
masterfrom
worktree-fix-b5
Open

fix: Keep pagination iterators advancing past fully-filtered pages#964
vdusek wants to merge 4 commits into
masterfrom
worktree-fix-b5

Conversation

@vdusek

@vdusek vdusek commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

The offset- and cursor-based pagination iterators stopped as soon as a page's items list 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=[] with x-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 limit and cursor is None checks are unchanged. Behavior is identical for every response without a divergent count (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

@vdusek vdusek added adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. labels Jul 20, 2026
@vdusek vdusek self-assigned this Jul 20, 2026
@github-actions github-actions Bot added this to the 145th sprint - Tooling team milestone Jul 20, 2026
@github-actions github-actions Bot added the tested Temporary label used only programatically for some analytics. label Jul 20, 2026
@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.62%. Comparing base (c1bffc6) to head (90ad295).
⚠️ Report is 8 commits behind head on master.

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              
Flag Coverage Δ
integration 92.26% <100.00%> (-0.05%) ⬇️
unit 83.89% <100.00%> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vdusek
vdusek requested a review from Pijukatel July 21, 2026 08:07
@vdusek
vdusek marked this pull request as ready for review July 21, 2026 08:07

@Pijukatel Pijukatel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please check the JS implementation as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants