Skip to content

GalleryFilesystem: follow paginated folder listings - #67

Open
tilorspace wants to merge 1 commit into
mainfrom
fix/gallery-fs-pagination
Open

tilorspace wants to merge 1 commit into
mainfrom
fix/gallery-fs-pagination

Conversation

@tilorspace

Copy link
Copy Markdown
Contributor

Problem

rspace_client.eln.fs.GalleryFilesystem (the PyFilesystem2 class Galaxy's shipped rspace file source is built on) read only the first page of /folders/tree:

  • Opening the filesystem: __init__ looks for the folder named Gallery in the Home listing. RSpace returns 20 items per page, newest first, and Gallery dates from account creation, so once a user has about 14 items of their own in Home the lookup raises StopIteration and Galaxy reports "Problem listing file source path".
  • Listing: listdir returned only the first page, so a Gallery folder with more than 20 entries showed only the newest 20 in Galaxy's picker. Galaxy's PyFilesystem2FilesSource._list goes filterdir → scandir → listdir.

Found while retesting against RSpace 2.27.0 and Galaxy 26.1: the integration tests had filled Home with test folders and the shipped plugin stopped working.

Fix

A small _all_records generator follows the listing's next links, used by both the Gallery lookup and listdir. The new fsspec filesystem on feature/fsspec-filesystem already pages this way.

Testing

  • Two new unit tests (ElnFilesystemPagingTest) fail without the fix and pass with it; the full unit suite passes.
  • Live, against RSpace 2.27.0 with 42 items in Home: the filesystem opens, and listdir on Miscellaneous and Images returns 31 and 25 entries, matching the server's totalHits.
  • In the Galaxy 26.1 container, the shipped rspace plugin lists the Gallery again with this eln/fs.py.

🤖 Generated with Claude Code

GalleryFilesystem looked for the Gallery folder on the first page of the
Home folder listing only, and listdir returned only the first page of a
folder. With RSpace's default page size of 20 and newest-first ordering,
the filesystem failed to open (StopIteration) once a user had about 14
items of their own in Home, and listings of Gallery folders with more
than 20 entries were silently truncated. Galaxy's shipped RSpace file
source is built on this class, so both showed up there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tilorspace

Copy link
Copy Markdown
Contributor Author

looks good to me. could you take a brief look as well @nebay-abraha ?

@tilorspace tilorspace self-assigned this Oct 9, 2026
@tilorspace tilorspace added the bug label Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant