Skip to content

chore: adjust page_offset() to always respect limit#472

Merged
toph-allen merged 3 commits intomainfrom
toph/respect-limit-on-paginated-endpoints
Oct 28, 2025
Merged

chore: adjust page_offset() to always respect limit#472
toph-allen merged 3 commits intomainfrom
toph/respect-limit-on-paginated-endpoints

Conversation

@toph-allen
Copy link
Contributor

Intent

Adjust page_offset() to never return more objects than the specified limit, even if more would be returned based on the page_size.

Fixes #469

Approach

  • Subset the aggregated results before returning.
  • Adjusted test fixtures and tests so that search_content()'s tests can be used to test the behavior of limit.

Checklist

  • Does this change update NEWS.md (referencing the connected issue if necessary)?
  • Does this change need documentation? Have you run devtools::document()?

Co-authored-by: Neal Richardson <neal.p.richardson@gmail.com>
@toph-allen toph-allen requested a review from jonkeane October 17, 2025 14:42
Copy link
Collaborator

@karawoo karawoo left a comment

Choose a reason for hiding this comment

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

nice simple fix 👍

@toph-allen toph-allen merged commit ea54c01 into main Oct 28, 2025
22 checks passed
@toph-allen toph-allen deleted the toph/respect-limit-on-paginated-endpoints branch October 28, 2025 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

limit argument to page_offset doesn't work if limit < page_size

4 participants