Skip to content

Commit

Permalink
Fix Pagination when token is an array (#1811)
Browse files Browse the repository at this point in the history
  • Loading branch information
jderusse authored Nov 26, 2024
1 parent ff54256 commit 52bb7f0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## NOT RELEASED

### Changed

- fix pagination when next token is an array

## 3.3.0

### Added
Expand Down
2 changes: 1 addition & 1 deletion src/Result/BatchGetItemOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function getConsumedCapacity(bool $currentPageOnly = false): iterable
$page = $this;
while (true) {
$page->initialize();
if (null !== $page->unprocessedKeys) {
if ([] !== $page->unprocessedKeys) {
$input->setRequestItems($page->unprocessedKeys);

$this->registerPrefetch($nextPage = $client->batchGetItem($input));
Expand Down
2 changes: 1 addition & 1 deletion src/Result/QueryOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public function getItems(bool $currentPageOnly = false): iterable
$page = $this;
while (true) {
$page->initialize();
if (null !== $page->lastEvaluatedKey) {
if ([] !== $page->lastEvaluatedKey) {
$input->setExclusiveStartKey($page->lastEvaluatedKey);

$this->registerPrefetch($nextPage = $client->query($input));
Expand Down
2 changes: 1 addition & 1 deletion src/Result/ScanOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public function getItems(bool $currentPageOnly = false): iterable
$page = $this;
while (true) {
$page->initialize();
if (null !== $page->lastEvaluatedKey) {
if ([] !== $page->lastEvaluatedKey) {
$input->setExclusiveStartKey($page->lastEvaluatedKey);

$this->registerPrefetch($nextPage = $client->scan($input));
Expand Down

0 comments on commit 52bb7f0

Please sign in to comment.