Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

storage.from().list() has limit: 0 by default #143

Closed
AlfonzAlfonz opened this issue Mar 31, 2021 · 1 comment
Closed

storage.from().list() has limit: 0 by default #143

AlfonzAlfonz opened this issue Mar 31, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@AlfonzAlfonz
Copy link

AlfonzAlfonz commented Mar 31, 2021

Bug report

Describe the bug

storage.from().list() without prefix argument returns empty result. According to types and docs it is optional but it is required in the api. If I use empty string it works as intended.

EDIT: After further inspection I found out that it is not caused by path being empty, but search options contains limit: 0 by default which causes the empty array.

To Reproduce

  1. Create a bucket with some files.
  2. Call: supabase.storage.from("gallery").list()
  3. Supabase returns empty result
  4. Call: supabase.storage.from("gallery").list("", { limit: 10 )
  5. Supabase returns list of all files

Expected behavior

If the list function is called without prefix, it should use "" instead.

System information

  • OS: macOS
  • Version of supabase-js: 1.7.6
  • Version of Node.js: 14.12.0
@AlfonzAlfonz AlfonzAlfonz added the bug Something isn't working label Mar 31, 2021
@AlfonzAlfonz AlfonzAlfonz changed the title storage.from().list() without prefix returns empty array storage.from().list() has limit: 0 by default Mar 31, 2021
@inian
Copy link
Member

inian commented Apr 6, 2021

Hi @AlfonzAlfonz, thanks for the report! This was fixed in #144. Please upgrade your supabase-js version to pull in the latest changes.

@inian inian closed this as completed Apr 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants