Skip to content

Commit 52bb7f0

Browse files
authored
Fix Pagination when token is an array (#1811)
1 parent ff54256 commit 52bb7f0

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## NOT RELEASED
44

5+
### Changed
6+
7+
- fix pagination when next token is an array
8+
59
## 3.3.0
610

711
### Added

src/Result/BatchGetItemOutput.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function getConsumedCapacity(bool $currentPageOnly = false): iterable
8383
$page = $this;
8484
while (true) {
8585
$page->initialize();
86-
if (null !== $page->unprocessedKeys) {
86+
if ([] !== $page->unprocessedKeys) {
8787
$input->setRequestItems($page->unprocessedKeys);
8888

8989
$this->registerPrefetch($nextPage = $client->batchGetItem($input));

src/Result/QueryOutput.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public function getItems(bool $currentPageOnly = false): iterable
116116
$page = $this;
117117
while (true) {
118118
$page->initialize();
119-
if (null !== $page->lastEvaluatedKey) {
119+
if ([] !== $page->lastEvaluatedKey) {
120120
$input->setExclusiveStartKey($page->lastEvaluatedKey);
121121

122122
$this->registerPrefetch($nextPage = $client->query($input));

src/Result/ScanOutput.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public function getItems(bool $currentPageOnly = false): iterable
116116
$page = $this;
117117
while (true) {
118118
$page->initialize();
119-
if (null !== $page->lastEvaluatedKey) {
119+
if ([] !== $page->lastEvaluatedKey) {
120120
$input->setExclusiveStartKey($page->lastEvaluatedKey);
121121

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

0 commit comments

Comments
 (0)