supabase / supabase-swift

A Swift client for Supabase
https://supabase.com/docs/reference/swift
MIT License
711 stars 107 forks source link

Issue listing 'folders' in Swift Supabase Storage #479

Closed Axxou closed 3 months ago

Axxou commented 3 months ago

Bug report

Describe the bug

I try to fetch all files from a bucket in swift. Using this code : https://supabase.com/docs/reference/swift/storage-from-list

Sadly, the result is not the same as the fetch from the typescript equivalent.

To Reproduce

Code for Swift :

let response = try await SupabaseClientManager.shared.publicClient.storage.from("xxxxxxx").list(
                    path: "963f4563-efdc-4d3a-a629-xxxxxxx",
                    options: Supabase.SearchOptions(
                        limit: 100,
                        offset: 0,
                        sortBy: Supabase.SortBy(column: "name", order: "asc")
                    )
                )

Code for Typescript :

const { data: objectsData, error: objectsError } =
        await supabasePublic.storage.from("xxxxxxxx").list("963f4563-efdc-4d3a-a629-xxxxxxxxx", {
          limit: 100,
          offset: 0,
          sortBy: { column: "name", order: "asc" },
        });

Expected behavior

List all the folders like typescript does.

Screenshots

image

System information

Additional context

Each folders get a ".placeholder" at the creation so they are not empty.

grdsdev commented 3 months ago

Hi @Axxou

I have an open PR that will fix that issue https://github.com/supabase/supabase-swift/pull/454

Thanks for reporting it.