Repository navigation
fix: use the new cursor and page size when fetching the next page - #404
Open
Alex Castillo González (pcbeingused33) wants to merge 1 commit into
Open
Alex Castillo González (pcbeingused33) wants to merge 1 commit into
Alex Castillo González (pcbeingused33) wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Alex Castillo González (pcbeingused33)
requested review from
a team
as code owners
November 27, 2026 04:27
This branch has not been deployed
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.
getNextPage()can return the same page over and over, so a loop over pages never advances (description below, no linked issue).The params of the previous request are stored in
_paramsand merged on top of the new ones (array_merge($params, $userParams)), so an olderbefore_id/after_idreplaces the new cursor, and an olderpage_sizereplaces the$pageSizeargument. This happens when the first call already contained a cursor, and also with a plainall(): the second page stores its ownbefore_idin_params, so the third request asks for the second page again.The previous params are now the base, and the new cursor (plus
$pageSizewhen given) is applied after them, inBaseService::getNextPageResourcesandUserService::getNextPageOfChildren. Other filters are still carried over.ReportService::getNextPagehas the same merge order, butReportService::all()never stores_params, so it is left unchanged.Testing
Added
test/EasyPost/PaginationTest.php, which uses the mocking utility and a request hook to check the params sent for the next page; its 3 tests fail without the fix and pass with it. The existing cassettes replay unchanged with the new param order; they were not re-recorded, since that needs EasyPost API keys. Locally the full suite has 2 errors inWebhookTestbecause the PHP build used lacksintl(Normalizer).phpcspasses.Pull Request Type
This change was prepared with the help of an AI coding assistant.