Skip to content

Conversation

mouize
Copy link

@mouize mouize commented Oct 2, 2025

Summary

This PR adds support for arbitrary filename prefix filtering to the GoogleCloudStorageAdapter::listContents() method.

Currently, the adapter forces a trailing / on the prefix, which prevents listing objects by filename prefix.
Ex: my_folder/my_file_prefixes_

This PR removes the forced /, allowing both directory and filename prefix listing as supported by Google Cloud Storage natively.

Why
• GCS natively supports prefix filtering server-side.
• Current adapter prevents efficient listing of large buckets by filename prefix.
• This makes Flysystem closer to native GCS behavior.

Fixes #1879

@frankdejonge
Copy link
Member

Hi, this would be a breaking change on the behavioural contract so will not be merged as it. What is possible, is to add a listContentsAsPrefix option (default to false) to allow people to opt-in to this behaviour.

@mouize
Copy link
Author

mouize commented Oct 10, 2025

Hi, this would be a breaking change on the behavioural contract so will not be merged as it. What is possible, is to add a listContentsAsPrefix option (default to false) to allow people to opt-in to this behaviour.

Right ! Thx for the review. Just pushed a new update

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.

Support prefix filtering on listContents() for file name prefixes (not only “directory” prefixes)

3 participants