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

Upload and Update with upsert seems to only work for Upload #194

Open
2 tasks done
silentworks opened this issue Feb 29, 2024 · 0 comments
Open
2 tasks done

Upload and Update with upsert seems to only work for Upload #194

silentworks opened this issue Feb 29, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@silentworks
Copy link

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

It would seem this library is doing something odd and against what the docs are stating. The docs state that if you set the upsert option to true while using the update method it should overwrite the file, but in the codebase it would seem the x-upsert header which is what upsert changes to is only set when doing a POST request and not a PUT. This means that only on the upload method does this option have any effect.

To Reproduce

You can take a look at the method here: https://github.com/supabase/storage-js/blob/main/src/packages/StorageFileApi.ts#L84
You can have a look at the docs describing this here: https://supabase.com/docs/reference/javascript/storage-from-update?example=update-file

Expected behavior

when the upsert option is set to true when using the update method, it should set the x-upsert header.

Screenshots

If applicable, add screenshots to help explain your problem.

System information

  • OS: [e.g. macOS, Windows]
  • Browser (if applies) [e.g. chrome, safari]
  • Version of supabase-js: [e.g. 6.0.2]
  • Version of Node.js: [e.g. 10.10.0]

Additional context

Add any other context about the problem here.

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

1 participant