mirror of
https://github.com/supabase/supabase.git
synced 2026-12-05 16:09:06 +00:00
## Problem `/project/[ref]/settings/billing/usage` only redirects: to infrastructure settings for the `#cpu`, `#ram` and `#disk_io` hashes, and to the org usage page otherwise. The redirect runs on the client because it reads the URL hash. It used `navigate` with the default push behaviour, so the redirect page stayed in history. Pressing Back landed on the redirect page, which sent the user forward again, and the user could not go back. ## Solution Pass `replace: true` to both `navigate` calls in `apps/studio/routes/project/$ref/settings/billing/usage.tsx`, so the redirect replaces its own history entry. ## How to verify 1. From any project page, open `/project/<ref>/settings/billing/usage#cpu`. You land on `/project/<ref>/settings/infrastructure#cpu`. Pressing Back returns to the project page you came from, not to the infrastructure page again. 2. From any project page, open `/project/<ref>/settings/billing/usage` with no hash. You land on `/org/<slug>/usage?projectRef=<ref>`. Pressing Back returns to the project page you came from. ## Checks - `pnpm turbo run typecheck --filter='...[origin/master]'`: passed. - `eslint` on the changed file: passed. Prettier `--check`: passed. - `pnpm turbo run lint --filter='[origin/master]'` ran out of memory twice in the sandbox (`studio#lint:type-checks`). [FE-5120](https://linear.app/supabase/issue/FE-5120/project-billing-usage-redirect-breaks-the-back-button) Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com>