Skip to content

fix: Change the PageIterator logic to avoid making double calls on Current#9236

Open
Hectorhammett wants to merge 2 commits into
mainfrom
fix-paginator
Open

fix: Change the PageIterator logic to avoid making double calls on Current#9236
Hectorhammett wants to merge 2 commits into
mainfrom
fix-paginator

Conversation

@Hectorhammett

Copy link
Copy Markdown
Collaborator

The logic for PageIterator had a hidden bug:
The PageIterator implements the Iterator class and the usage of PHP iterator. If the user were to use the current method on the iterator (eg: $rows->getIterator()->current()) the iterator would check if the first page was filled, if not it would perform an API call.

The way it was setup, calling current without calling rewind would always end up with an API call, meaning that in some cases the users would end up with a repeated API call even when the results where already in memory.

This PR aims to fix that.

@Hectorhammett Hectorhammett requested a review from a team as a code owner June 8, 2026 20:33
@Hectorhammett

Copy link
Copy Markdown
Collaborator Author

This aims to fix #9168

Comment thread Core/src/Iterator/PageIteratorTrait.php Outdated
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.

2 participants