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
2.89k stars 223 forks source link

Unable to move objects between buckets #1049

Open huaizhic opened 2 weeks ago

huaizhic commented 2 weeks 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.