docs: document scanIterator()/scanPrefixIterator() (#391) - #539
Merged
Conversation
s2x
force-pushed
the
fix/391-doc-scan-iterators
branch
from
September 9, 2026 18:46
b3f4888 to
bdf509a
Compare
s2x
marked this pull request as ready for review
September 9, 2026 18:46
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.
Description
Documents
RawKvClient::scanIterator()/scanPrefixIterator()(issue #391, audit finding DOC-25) — previously the only mention anywhere was a line in the README file tree, while the docs taught a hand-rolledScanPaginatorwhoseincrementKey()produced a smaller end key for0xFF-terminated prefixes (silently empty scans).All claims verified against
src/Client/RawKv/ScanIterator.php,RawKvScanner.phpandRawKvClient.php.Closes #391
Changes
docs/operations.md: new Iterating Large Ranges subsection — both signatures (batchSize = 256default, bounds1 <= batchSize <= 10240validated synchronously withInvalidArgumentException),keyOnlynull-value behaviour, page/continuation mechanics (one page in memory, continues fromlastKey . "\x00", exhausts on a short page), rewindable re-scan-from-start, lazy RPCs/exceptions during iteration, no reverse iterator; the manual pagination loop in the Scan section is replaced by the iterator.docs/advanced.md: the hand-rolledScanPaginatorclass is deleted and replaced with the built-in iterators, plus an explicit warning about the wrongchr($lastByte + 1)prefix-end arithmetic vsRawKvSplitter::calculatePrefixEndKey().README.md: iterator examples in the Scanning section and a bullet under Implemented Operations → Scanning.docs/troubleshooting.md: the 10240 scan-limit row now cross-references the iterators.CHANGELOG.md: new### Documentationentry under[Unreleased]([DOC-25], [DOC-25] DocumentscanIterator()/scanPrefixIterator()#391).Changelog
scanIterator()/scanPrefixIterator()documented indocs/operations.md(Iterating Large Ranges) with signatures,batchSizebounds (1..10240),keyOnlynull values, page/continuation/rewind semantics and lazy-exception behaviour; the buggy hand-rolledScanPaginatorindocs/advanced.mdand the manual pagination loop indocs/operations.mdare replaced with the built-in iterators, cross-referenced from README and the troubleshooting scan-limit row. ([DOC-25] DocumentscanIterator()/scanPrefixIterator()#391)Code Review