Skip to content

Conversation

@joshenlim
Copy link
Member

Context

Handles re-routing logic when landing on a [bucketId] page that doesn't exist for analytics and vector buckets.

Changes involved

  • Refactor useSelectedBucket to only consider file buckets, remove analytics bucket logic
  • Route back to /storage/analytics if landing on an analytics bucket ID that doesn't exist
  • Route back to /storage/vectors if landing on an vector bucket ID that doesn't exist
  • Update files bucket to route back to /storage/files if landing on a files bucket ID that doesn't exist

To test

  • Try landing on a bucket ID that doesn't exist for files, analytics and vector buckets

@joshenlim joshenlim requested a review from a team as a code owner November 13, 2025 11:09
@supabase
Copy link

supabase bot commented Nov 13, 2025

This pull request has been ignored for the connected project xguihxuzqibwxjnimxev because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@vercel
Copy link

vercel bot commented Nov 13, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
studio-self-hosted Ready Ready Preview Comment Nov 14, 2025 4:16am
studio-staging Ready Ready Preview Comment Nov 14, 2025 4:16am
6 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
studio Ignored Ignored Nov 14, 2025 4:16am
cms Skipped Skipped Nov 14, 2025 4:16am
design-system Skipped Skipped Nov 14, 2025 4:16am
docs Skipped Skipped Nov 14, 2025 4:16am
ui-library Skipped Skipped Nov 14, 2025 4:16am
zone-www-dot-com Skipped Skipped Nov 14, 2025 4:16am

@coveralls
Copy link

Coverage Status

coverage: 68.718%. remained the same
when pulling bab2f88 on joshen/depr-262-bucketid-route-needs-to-handle-if-a-bucket-doesnt-exist
into cb72c30 on master.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 13, 2025

Studio E2E Results

  • Total: 1
  • Passed: 1
  • Failed: 0
  • Skipped: 0
  • Timed out: 0
  • Interrupted: 0
  • Flaky: 0
  • Duration: 2.7s

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 }
Copy link
Member

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).

Copy link
Member Author

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!

Copy link
Member

@alaister alaister left a 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

@joshenlim joshenlim merged commit 8b5a087 into master Nov 14, 2025
19 of 21 checks passed
@joshenlim joshenlim deleted the joshen/depr-262-bucketid-route-needs-to-handle-if-a-bucket-doesnt-exist branch November 14, 2025 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants