Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## v8.10.1 (2026-11-30)

- Fixes `getNextPage` and `getNextPageOfChildren` requesting the same page again when the previous request params already contained a cursor, and ignoring the `pageSize` argument when the previous params had a `page_size`, and sending both `before_id` and `after_id` when the previous params already contained the other cursor (thanks @pcbeingused33)

## v8.10.0 (2026-11-09)

- Adds `delivery_evidence` to `Tracker` and a `DeliveryEvidence` model
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "easypost/easypost-php",
"description": "EasyPost Shipping API Client Library for PHP",
"version": "8.10.0",
"version": "8.10.1",
"keywords": [
"shipping",
"api",
Expand Down
2 changes: 1 addition & 1 deletion lib/EasyPost/Constant/Constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ abstract class Constants
const BETA_API_VERSION = 'beta';

// Library constants
const LIBRARY_VERSION = '8.10.0';
const LIBRARY_VERSION = '8.10.1';
const SUPPORT_EMAIL = 'support@easypost.com';

// Validation
Expand Down
11 changes: 6 additions & 5 deletions lib/EasyPost/Service/BaseService.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,14 @@ protected function getNextPageResources(string $class, mixed $collection, ?int $
throw new EndOfPaginationException();
}

$params = [
'page_size' => $pageSize,
// The new cursor (and page size, if given) must win over the params of the previous request
$params = array_merge($userParams ?? [], [
'before_id' => $collectionArray[count($collectionArray) - 1]['id']
];
]);
unset($params['after_id']);

if (isset($userParams)) {
$params = array_merge($params, $userParams);
if (isset($pageSize)) {
$params['page_size'] = $pageSize;
}

$response = $this->allResources($class, $params);
Expand Down
12 changes: 7 additions & 5 deletions lib/EasyPost/Service/ReportService.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public function all(mixed $params = null): mixed
unset($params['type']);
$response = Requestor::request($this->client, HttpMethod::GET, $url, $params);
$response['type'] = $type;
$response['_params'] = $params;

return InternalUtil::convertToEasyPostObject($this->client, $response);
}
Expand All @@ -64,13 +65,14 @@ public function getNextPage(mixed $reports, ?int $pageSize = null): mixed
throw new EndOfPaginationException();
}

$params = [
'page_size' => $pageSize,
// The new cursor (and page size, if given) must win over the params of the previous request
$params = array_merge($userParams ?? [], [
'before_id' => $reportArray[count($reportArray) - 1]['id']
];
]);
unset($params['after_id']);

if (isset($userParams)) {
$params = array_merge($params, $userParams);
if (isset($pageSize)) {
$params['page_size'] = $pageSize;
}

$url = self::reportUrl($reportArray[0]->object);
Expand Down
11 changes: 6 additions & 5 deletions lib/EasyPost/Service/UserService.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,14 @@ public function getNextPageOfChildren(mixed $children, ?int $pageSize = null): m
throw new EndOfPaginationException();
}

$params = [
'page_size' => $pageSize,
// The new cursor (and page size, if given) must win over the params of the previous request
$params = array_merge($userParams ?? [], [
'after_id' => $userArray[count($userArray) - 1]['id']
];
]);
unset($params['before_id']);

if (isset($userParams)) {
$params = array_merge($params, $userParams);
if (isset($pageSize)) {
$params['page_size'] = $pageSize;
}

// Retrieve a page of users from the server
Expand Down
Loading