-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Joshen/depr 262 bucketid route needs to handle if a bucket doesnt exist #40430
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
Joshen/depr 262 bucketid route needs to handle if a bucket doesnt exist #40430
Conversation
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
6 Skipped Deployments
|
|
Studio E2E Results
Artifacts: https://github.com/supabase/supabase/actions/runs/19354018938 Last updated: Friday 14, November, 2025 04:24:14 (UTC) |
|
|
||
| const bucket = data.find((x) => x.id === bucketId) | ||
|
|
||
| return { data: bucket, isLoading, isSuccess, isError, error } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If possible we should be returning the query result directly instead of returning a new object. That way the react-query typing magic will continue to work.
You can get the same result by using select in the react query options to do the data.find((x) => x.id === bucketId).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can get the same result by using select in the react query options to do the data.find((x) => x.id === bucketId).
oooh TIL will take a look in a bit!
alaister
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
- Tested on preview
Context
Handles re-routing logic when landing on a
[bucketId]page that doesn't exist for analytics and vector buckets.Changes involved
useSelectedBucketto only consider file buckets, remove analytics bucket logic/storage/analyticsif landing on an analytics bucket ID that doesn't exist/storage/vectorsif landing on an vector bucket ID that doesn't exist/storage/filesif landing on a files bucket ID that doesn't existTo test