supabase / supabase-js

An isomorphic Javascript client for Supabase. Query your Supabase database, subscribe to realtime events, upload and download files, browse typescript examples, invoke postgres functions via rpc, invoke supabase edge functions, query pgvector.
https://supabase.com
MIT License
3.27k stars 271 forks source link

Unable to move objects between buckets #1049

Open huaizhic opened 6 months ago

huaizhic commented 6 months ago

Bug report

Describe the bug

A clear and concise description of what the bug is.

From the docs (https://supabase.com/docs/guides/storage/management/copy-move-objects), it mentions the ability to copy/move objects from one bucket to another by adding a destinationBucket header to the API call. However, the object is only moved/copied within the same bucket, effectively ignoring the destinationBucket header added at the end.

To Reproduce

Screenshot 2024-05-16 144842

Source Bucket: 'catalog-public' Source Bucket path: 'testing/testing(slot1)' Destination Bucket: 'catalog-private' Destination Bucket path: 'testing2/testing(slot1)'

Expected behavior

File 'testing(slot1)', from folder 'testing', is expected to be copied/moved from bucket 'catalog-public' to folder 'testing2' in bucket 'catalog-private'.

Screenshots

However, the file is being copied/moved in the source bucket 'catalog-public' instead.

image

System information

Additional context

I have made RLS policies of the buckets to allow anonymous users to make modifications in order to isolate the problem.

Bloodyaugust commented 5 months ago

For me, when using typescript, there's not even a 3rd argument accepted for this function.

https://supabase.com/docs/guides/storage/management/copy-move-objects mentions this capability and shows the code, but https://supabase.com/docs/reference/javascript/storage-from-move does not mention this capability. Is this something that used to exist as a capability, but was removed at some point? If so, having it back would be great.