Skip to content

fix: correct boolean parsing of pagination desc header in list_items#621

Merged
vdusek merged 2 commits intomasterfrom
fix/dataset-list-items-desc-parsing
Feb 17, 2026
Merged

fix: correct boolean parsing of pagination desc header in list_items#621
vdusek merged 2 commits intomasterfrom
fix/dataset-list-items-desc-parsing

Conversation

@vdusek
Copy link
Contributor

@vdusek vdusek commented Feb 17, 2026

Summary

  • bool(response.headers['x-apify-pagination-desc']) always returns True for any non-empty string, including "false"
  • The desc field in ListPage from list_items was always True regardless of the actual API response
  • Fixed by using explicit string comparison: .lower() == 'true' (both sync and async variants)

Test plan

  • Verify existing unit tests pass
  • Verify list_items(desc=False) returns ListPage with desc=False

🤖 Generated with Claude Code

bool() on a string header value returns True for any non-empty string,
including the string "false". This caused the desc field in ListPage to
always be True. Use explicit string comparison instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vdusek vdusek added bug Something isn't working. adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. labels Feb 17, 2026
@vdusek vdusek self-assigned this Feb 17, 2026
@vdusek vdusek added bug Something isn't working. adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. labels Feb 17, 2026
@github-actions github-actions bot added this to the 134th sprint - Tooling team milestone Feb 17, 2026
@codecov
Copy link

codecov bot commented Feb 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.02%. Comparing base (e7ee8b3) to head (11ae4cc).
⚠️ Report is 7 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #621   +/-   ##
=======================================
  Coverage   76.02%   76.02%           
=======================================
  Files          42       42           
  Lines        2482     2482           
=======================================
  Hits         1887     1887           
  Misses        595      595           
Flag Coverage Δ
integration 68.77% <ø> (ø)
unit 65.31% <ø> (+0.64%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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 February 17, 2026 15:29
Copy link
Contributor

@Pijukatel Pijukatel left a comment

Choose a reason for hiding this comment

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

This fix would be nice with a test

Verify that the x-apify-pagination-desc header is correctly parsed
as a boolean using string comparison, covering both sync and async
clients with various casing (true/True/TRUE/false/False/FALSE).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions bot added the tested Temporary label used only programatically for some analytics. label Feb 17, 2026
@vdusek vdusek merged commit 9ca9d44 into master Feb 17, 2026
30 checks passed
@vdusek vdusek deleted the fix/dataset-list-items-desc-parsing branch February 17, 2026 16:24
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. bug Something isn't working. 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.

2 participants

Comments