Skip to content

Bug: fetchMoreFolderContents uses wrong prefix in column view pagination #43799

Closed

Description

@karesansui-u

Bug report

Describe the bug

In the Storage Explorer column view, fetchMoreFolderContents computes the API prefix using all openedFolders instead of slicing to the target column index. This causes "load more" pagination in non-leaf columns to fetch objects from the wrong directory.

fetchFolderContents correctly slices:

// storage-explorer.tsx L335-338
const prefix = state.openedFolders
  .slice(0, index + 1)
  .map((folder) => folder.name)
  .join('/')

fetchMoreFolderContents does not:

// storage-explorer.tsx L398
const prefix = state.openedFolders
  .map((folder) => folder.name)
  .join('/')

Both functions accept an index parameter, but fetchMoreFolderContents ignores it for prefix computation.

Severity

Users see files from the wrong directory when paginating in column view. If they act on those files (download, delete, move), the operation targets wrong objects.

To reproduce

  1. Open Storage Explorer in column view
  2. Create or navigate into nested folders (e.g. A → B → C)
  3. Ensure the root column (or folder A) has enough items to trigger pagination (100+ items, or reduce LIMIT constant for testing)
  4. In that non-leaf column, scroll down to trigger "load more"
  5. The additional items are fetched from the deepest path (A/B/C) instead of the column's actual path

Expected behavior

fetchMoreFolderContents should use .slice(0, index + 1) like fetchFolderContents does, so pagination fetches objects from the correct directory.

Suggested fix

- const prefix = state.openedFolders.map((folder) => folder.name).join('/')
+ const prefix = state.openedFolders
+   .slice(0, index + 1)
+   .map((folder) => folder.name)
+   .join('/')

System information

  • Reviewed on commit 77e5180c (master)
  • File: apps/studio/state/storage-explorer.tsx, line 398

Additional context

This was missed during the refactor in #43541. The refactor correctly updated fetchFolderContents but missed the parallel function fetchMoreFolderContents.

Activity

  1. added
    external-issue
    on Mar 16, 2026
  2. added
    pr-opened
    and removed on Mar 16, 2026
  3. added
    bug
    frontend
    on Mar 20, 2026
  4. added a commit that references this issue on Mar 27, 2026
    753638c
  5. added a commit that references this issue on Mar 30, 2026
    6662572
  6. added a commit that references this issue on Apr 15, 2026
    4a63c6e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugexternal-issuefrontendpr-opened

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions