You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Not sure this is a bug or a feature, but the Storage function getPublicUrl always returns a public url, even is the file does not exist. Firebase Storage provides a null in that scenario, which can then be used in the application to show an upload form. With the current Supabase flow, I need to test myself if the file exists (not sure how to be honest) and then show a form.
To Reproduce
Create a bucket, make it public, leave it empty. Create a function to query a specific file
Expected behavior
A response that either errors or nulls
Screenshots
Smartphone (please complete the following information):
@jstdk getPublicUrl is just a method that constructs a url from given parameters such as supabase url, bucket name, and path, so no it does not check if a file exists or not.
You can use the createSignedUrl method to get a URL if a file exists, or throw an error if it does not exist.
@Vinzent03@jstdk You can still use createSignedUrl on public buckets. Also, in the original issue, it brings up how Firebase storage is able to detect whether a file exists or not. In Firebase storage, every URL it returned is a signed URL, so the use case is exactly the same as calling createSignedUrl to see if there is a file there on Supabase.
If you don't want to use createSignedUrl, nothing is stopping you from making a HTTP request to the URL to see if it returns 404 or not. You could make a HTTP HEAD request to efficiently see if a file exists or not.
Describe the bug
Not sure this is a bug or a feature, but the Storage function getPublicUrl always returns a public url, even is the file does not exist. Firebase Storage provides a null in that scenario, which can then be used in the application to show an upload form. With the current Supabase flow, I need to test myself if the file exists (not sure how to be honest) and then show a form.
To Reproduce
Create a bucket, make it public, leave it empty. Create a function to query a specific file
Expected behavior
A response that either errors or nulls
Screenshots
Smartphone (please complete the following information):
Additional context
Repo: https://github.com/jstdk/starter
The text was updated successfully, but these errors were encountered: