Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Jun 2, 2026. It is now read-only.
This repository was archived by the owner on Jun 2, 2026. It is now read-only.

FakeStorageRpc: Consider filtering by bucket *and* prefix. #207

Copy link
Copy link

Description

@yuri-sergiichuk
Issue body actions

Environment details

  1. FakeStorageRpc
  2. OS type and version: Win 10
  3. Java version: java 8
  4. google-cloud-nio version(s): 0.121.2

Steps to reproduce

  1. Add object with name "test-object" to bucket "first-bucket",
  2. Add object with name "test-object" to bucket "second-bucket".
  3. List objects in "first-bucket" with "test-" prefix.
  4. Both "test-object" files from "first-bucket" and "second-bucket" are returned.

Any additional information below

The list method in the FakeStorageRpc does not take into account the bucket metadata:

    for (StorageObject so : metadata.values()) {
      if (!so.getName().startsWith(prefix)) {                       // <---------- here's the problem
        continue;
      }
      if (processedAsFolder(so, delimiter, prefix, folders)) {
        continue;
      }
      so.setSize(size(so));
      values.add(so);
    }

Technically, just adding an extra check to compare the so.getBucket() with bucket should be enough to resolve the issue.

Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

api: storageIssues related to the googleapis/java-storage-nio API.Issues related to the googleapis/java-storage-nio API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

Morty Proxy This is a proxified and sanitized view of the page, visit original site.