Skip to content

storage root lists all files flattened (empty path param sent to backend) #3106

Description

@alexzandermatveev

Environment

  • OpenList v4.2.6 (docker image openlistteam/openlist:latest)
  • Driver: Teldrive
  • Backend: Teldrive v1.8.3 (tgdrive/teldrive)

Describe the bug
Listing the storage root of a Teldrive storage shows the user's entire file tree
flattened in one list instead of the actual root directory children. Navigating
into subdirectories works correctly.

Root cause
For the storage root the driver issues GET /api/files without a path query
parameter
(the root dir object's GetPath() returns an empty string). Teldrive
treats a missing/empty path as "no path filter" and returns every user file:

  • GET /api/files?path=/ -> correct root children (2 items)
  • GET /api/files -> ALL user files flattened (54 items)
  • GET /api/files?path=/oldDisk -> correct children (11 items)

Additionally, setting "Root folder path" (root_folder_path) on the storage has
no effect: the Teldrive driver never reads d.RootPath.

Steps to reproduce

  1. Add a Teldrive storage (url + access_token cookie).
  2. Open the storage root in the web UI -> all files are shown flattened.
  3. Open any subfolder -> listing is correct.

Expected behavior
The storage root should list the Teldrive root directory (i.e. request with
path=/).

Suggested fix
In drivers/teldrive/driver.go, List():

p := dir.GetPath()
if p == "" {
    p = "/"
}

and use p in the query params of both the first page request and the
pagination requests. Optionally honor d.RootPath to allow mounting a subfolder
as the storage root.

Side note for upstream Teldrive (tgdrive/teldrive): /api/files currently
returns the whole user tree when path is missing/empty instead of rejecting
the request - it might be worth requiring the parameter there as well.

Activity

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

    invalidInvalid Content/Cannot Reproduce

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions