fix(gcs): paginate object prefixes with maxResults - #189
Open
electrum wants to merge 1 commit into
Open
Conversation
|
| Filename | Overview |
|---|---|
| src/main/java/io/floci/gcp/services/gcs/GcsObjectController.java | Combines objects and prefixes into one deterministic result sequence before applying pagination. |
| src/test/java/io/floci/gcp/services/gcs/GcsListFilterRestIntegrationTest.java | Covers combined object-prefix pages, shared result slots, and stable version-generation continuation pages. |
| compatibility-tests/sdk-test-java/src/test/java/io/floci/gcp/test/GcsListFiltersTest.java | Verifies through the Java GCS SDK that directory prefixes honor page size and expose a continuation token. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[List matching objects] --> B{Delimiter supplied?}
B -- No --> C[Convert each object to a listed result]
B -- Yes --> D[Group objects by name]
D --> E[Sort same-name generations numerically]
E --> F[Merge ordered object names and prefixes]
F --> G[Pair a same-name prefix with first object generation]
G --> H[Emit remaining generations separately]
C --> I[Paginate combined listed results]
H --> I
I --> J[Split current page into items and prefixes]
J --> K[Return one shared nextPageToken]
Reviews (3): Last reviewed commit: "fix(gcs): paginate object prefixes with ..." | Re-trigger Greptile
electrum
force-pushed
the
user/electrum/gcs-list-max-results
branch
from
September 9, 2026 05:06
52099c9 to
27131d5
Compare
electrum
force-pushed
the
user/electrum/gcs-list-max-results
branch
from
September 9, 2026 05:18
27131d5 to
17e0911
Compare
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.
Summary
Applies
maxResultsto the combined object and prefix listing, with one page token covering both result types.Type of change
fix:)feat:)feat!:orfix!:)GCP Compatibility
The behavior was reproduced in real GCS with objects under
a/andb/:Floci previously returned every prefix and no page token because only
items[]participated in pagination. Real GCS was also checked withincludeTrailingDelimiter=true: a same-named prefix and object are both returned whenmaxResults=1, and together consume one result slot. With versioning enabled, each generation remains a separate, generation-ordered result slot while the same-named prefix is returned once, keeping continuation pages stable.Checklist
./mvnw testpasses locally