mirror of
https://github.com/supabase/supabase.git
synced 2026-12-05 16:09:06 +00:00
create-pull-request/patch
6129
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
395a54f2b7 |
feat(studio): gate jwt signing keys, legacy api keys, and third-party auth on grants (#53241)
Resolves [FE-4732](https://linear.app/supabase/issue/FE-4732/grants-rollout-jwt-signing-keys-legacy-api-keys-and-third-party-auth). ## Changes Gates the JWT signing keys, legacy API keys, and third-party auth endpoints on grants instead of `unguarded.migrating`, and replaces their V2 permission guards with `useGrant`: - **Data layer (11 sites):** `data/jwt-signing-keys/*`, `data/api-keys/legacy-api-keys-status-query`, `data/api-keys/legacy-api-key-toggle-mutation`, and `data/third-party-auth/*`. Queries become grant-gated query option factories; mutations take the grant in their variables. - **Consumers:** the JWT settings page, the JWT signing keys table and its dialogs, `jwt-settings`, `ToggleLegacyApiKeys`, `Project/APIKeys`, and the third-party auth page, form, and create dialogs. Each consumer renders denied and error states. - **JWT signing keys table:** - It's gated only on the signing keys reads (`GET signing-keys` and `GET signing-keys/legacy`, both `auth_signing_keys_read`). - The legacy API keys status is only used by the revoke dialogs. If it can't be read, revoking the legacy JWT secret fails closed: the user sees the "disable legacy API keys first" warning, with copy explaining why, instead of the confirm modal. - **Legacy JWT secret query:** a 404 (secret not imported as a signing key yet) resolves to `null` and shows the "Migrate JWT secret" panel. Other errors now render an error instead of being treated as "not migrated". - **Write actions:** - `getWriteGrantTooltip` moves from `APIKeys.utils` to `lib/grants` and takes a resource noun. Disabled write actions use it to explain why they're disabled. - New `getWriteGrantToastMessage`: handlers that run without a grant now show a toast instead of silently doing nothing. This includes the API keys handlers from #52966. ## Permission changes - **Legacy API keys toggle and status** (`GET`/`PUT /v1/projects/{ref}/api-keys/legacy`): the guard moves from `auth_signing_keys_read`/`_write` to the endpoint annotation, `api_gateway_keys_read`/`_write`. The annotation was confirmed against the backend controller (FE-4728). As a result, the JWT signing keys table's legacy revoke check now depends on `api_gateway_keys_read`. - **API keys last-used analytics** (`/platform/projects/{ref}/analytics/endpoints/api_keys.last_used.otel`): this endpoint uses legacy permissions (`analytics:Read` on `logflare`), not FGA. Its check moves from the V2 `auth_signing_keys_read` check to `useAsyncCheckPermissions(PermissionAction.ANALYTICS_READ, 'logflare')`. - Every other guard already matched its annotation: - `auth_signing_keys_read`/`_write` for signing keys - `auth_config_read`/`_write` for third-party auth ## Testing - Data layer: `jwt-signing-keys.test.ts`, `legacy-api-keys.test.ts`, and `third-party-auth.test.ts` cover every migrated fetcher, check that factories stay disabled without a grant, and cover legacy-key 404 vs. 500. - `jwt-secret-keys-table/index.platform.test.tsx`: - Legacy status denied: the table still renders, and revoking the legacy key shows only the warning. - Legacy status known enabled or disabled. - Signing keys read denied. - Legacy key 404 vs. 500. - `create-key-dialog.platform.test.tsx`: triggering create without a grant shows the toast and sends no request. - `ToggleLegacyApiKeys.platform.test.tsx`, `ThirdPartyAuthForm.platform.test.tsx`, and `settings/jwt/index.platform.test.tsx`: granted, denied, error, and partial-permission cases. - `lib/grants.test.ts`: the tooltip and toast helpers. 🤖 Generated with [Claude Code](https://claude.com/claude-code) |
||
|
|
c8aad267cb |
fix(studio): use read grant variant for table related resources queries (#53231)
Fixes the Studio typecheck failure on \`master\`. ## What Two PRs merged close together and conflict at the type level. #53079 added the table related resources queries with a plain \`POST /platform/pg-meta/{ref}/query\` grant. #53185 then made a variant required for that endpoint. Both queries only read data, so they now request and accept the \`read\` variant. ## Testing - \`tsc --noEmit\` in \`apps/studio\` passes. |
||
|
|
f8afb1ee05 |
chore: mark new temporary support role (#53211)
## Problem New temporary role that may be added during a support ticket. This shows up as a normal role, rather than reserved ## Solution New temporary read-only support role should be marked as supabase managed. <img width="1170" height="1057" alt="Image" src="https://github.com/user-attachments/assets/8e42ac26-e88f-4772-a1b4-d3efc2e5a850" /> ## Review instructions Provide a clear numbered procedure that the PR reviewer can walk through. 1. Create a support user on a staging project (admin-studio) 2. Check the role appears as a Supabase service role in /dashboard/project/_/database/roles ## Checklist Check all before review: - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) |
||
|
|
de63769998 |
feat(studio): add ability to purge CDN cache to storage UI (#52777)
## Problem Users should be able to purge the CDN cache for an individual object or entire bucket via the UI. This feature is only available for Pro+ customers. Free tier customers should be encouraged to upgrade to get access. ## Solution - Add a _Purge CDN cache_ action to the bucket menu. Prompt users on Free plan to upgrade if needed. <img width="182" height="149" alt="image" src="https://github.com/user-attachments/assets/b665c8d0-b540-400e-a328-85c48ddafee0" /> <img width="534" height="242" alt="image" src="https://github.com/user-attachments/assets/15dfd3d3-c8a9-4ad7-9046-0929fd715511" /> <img width="538" height="211" alt="image" src="https://github.com/user-attachments/assets/3e29644e-9335-4b1d-b321-49303c2e8476" /> - Add a _Purge CDN cache_ action to the bucket item menu. Prompt users on Free plan to upgrade if needed. <img width="283" height="313" alt="image" src="https://github.com/user-attachments/assets/a801297e-04b5-46c7-aaf7-4569e66e4714" /> <img width="541" height="249" alt="image" src="https://github.com/user-attachments/assets/b58d264b-76ba-43d4-9579-6c07be9cb684" /> <img width="537" height="207" alt="image" src="https://github.com/user-attachments/assets/132b37bd-3a29-48b5-aa7e-7df29abcbfe6" /> ## Notes - Refactored the _Edit bucket_ menu so that only one modal is allowed - Fixed focus management related to the modals displayed by the _Edit bucket_ menu items - Introduced a way to mock the authenticated users in tests ## Review instructions - On an org on at least _Pro_ plan - Open a bucket _Edit bucket_ menu and click _Purge CDN cache_ - Confirming should call the `/platform/storage/{ref}/cdn/purge-bucket` API endpoint - Open a bucket item menu and click _Purge CDN cache_ - Confirming should call the `/platform/storage/{ref}/cdn/purge-object` API endpoint - On an org on _Free_ plan - Open a bucket _Edit bucket_ menu and click _Purge CDN cache_ - You should be prompted to upgrade - Open a bucket item menu and click _Purge CDN cache_ - You should be prompted to upgrade --------- Co-authored-by: Joshen Lim <joshenlimek@gmail.com> |
||
|
|
4d28d1a809 |
feat(studio): throw MalformedResponse for empty JSON GET bodies (#53182)
Follows supabase/supabase#53048. Part of [FE-4772](https://linear.app/supabase/issue/FE-4772/error-core-tagged-error-types-and-rough-fault-classification-in). ## What `normalizeEmptyBodyResponse` already tries to recover empty success bodies (original body, then one `no-store` refetch). When a JSON `GET` is still empty after that, it now throws `MalformedResponseError` (reason `empty_body`) carrying `endpoint`, `method`, `requestId` and status, instead of resolving with `{}`, which crashes components. * Unchanged: 204s, `HEAD`, non-`GET` requests and empty non-JSON responses keep the `Content-Length: 0` normalization. * Reporting: the error rejects like a network failure, so React Query gets the tagged instance and `reportQueryError` reports it once after the last retry. The refetch diagnostics are attached as Sentry context, and the standalone empty-body diagnostic event is skipped for this case to avoid double reporting. Recovered cases still send the diagnostic. * Routing: `MalformedResponse` moves to `SAMPLE_ALWAYS`. It is rare, and while we confirm the recovery path is sufficient every unrecovered case should be visible. * An abort during recovery throws `RequestAborted`, not `MalformedResponse` ## Notes * Callers using `get()` directly outside React Query are not reported automatically, same as network errors. * No GET endpoint showed up as legitimately returning an empty JSON body in the existing empty-body diagnostics. ## Testing * `pnpm vitest run data lib components/interfaces/ErrorHandling state` passes. * Lint ratchet passes; `tsc` shows only a pre-existing error in `packages/ui-patterns` (`InstructionBlocks.tsx`). |
||
|
|
121de3dff7 |
feat(studio): gate api key create and delete on endpoint grants (#52966)
Part 6 of 6 in a stack for [FE-4731](https://linear.app/supabase/issue/FE-4731/grants-rollout-api-keys-consumers-that-only-need-publishable-keys). Based on #52965. ## Stack 1. #52961 Docs and project API docs consumers 2. #52962 Edge functions and vector bucket examples 3. #52963 Integrations landing data 4. #52964 Connect sheet and project connection popover; remove the transitional api-keys hooks 5. #52965 `reveal` refinement for single api-key reads; API key pill 6. 👉 #52966 API key create and delete ## Changes Gates the api-key write endpoints (both require `api_gateway_keys_write`) on grants instead of `unguarded.migrating`: - `api-key-create-mutation` and `api-key-delete-mutation` take the grant in their variables. - `APIKeyDeleteDialog` uses the `DELETE` grant instead of its V2 check, and is disabled with a tooltip when denied or errored. `SecretAPIKeys` and `PublishableAPIKeys` pass the grant to the mutation. - `CreateNewAPIKeysButton` and the create publishable and secret key dialogs mint the `POST` grant. Their triggers and submit buttons are disabled with a tooltip unless granted. - `useConnectedResourceMutations`: the api-key delete call takes the grant. Without it, the mutation shows an error toast and throws. **New guard:** creating API keys had no UI guard. Users without `api_gateway_keys_write` could open the dialogs and get a 403; the controls are now disabled for them. The delete guard already matched the annotation. Out of scope: the legacy API key toggle and status (FE-4732). ## Testing - `CreateAPIKeyDialogs.platform.test.tsx` (renamed from `CreateAPIKeyDialogs.test.tsx`, the mutation mock removed): denied and permission-check error disable the triggers and the submit button. - `APIKeyDeleteDialog.platform.test.tsx`: granted, denied, and permission-check error. - `data/api-keys/api-key-write-mutations.test.ts`: create and delete send their requests with a grant. 🤖 Generated with [Claude Code](https://claude.com/claude-code) |
||
|
|
44573b7a5c |
feat(studio): rename Advisors to Issues in navigation (#52993)
Part 5 of 6: #52989 → #52990 → #52991 → #52992 → #52993 → #53138 Switches Studio navigation between Advisors and Issues with `issuesInbox`. With the flag off, the existing Advisors sidebar, pages, command menu entries, shortcuts, header panel, and contextual finding links remain available. With it on, these entry points show Issues and legacy Advisor URLs forward to the matching Issues category while preserving finding context. Direct Issues routes remain accessible in either state. The homepage section remains hidden when the flag is off. Telemetry event names are unchanged. ## How to test 1. Turn `issuesInbox` off: desktop and mobile navigation show Advisors, the header opens Advisor Center, and Security, Performance, and enabled Health Advisor pages remain usable. 2. Turn it on: navigation and the header show Issues. Legacy Advisor category URLs forward to matching Issues lists. 3. `G` then `V` opens the active variant. `V` then `S`, `P`, or `H` follows the active category links; shortcut reference labels match. 4. Table Editor finding links open the legacy finding when off and its issue when on. 5. Direct Issues routes remain usable with the flag off; the homepage section stays hidden. ## Validation - Broad navigation/layout/redirect/shortcut regression suite: 456 tests passed, retries disabled. - Focused suite: 181 tests passed with shuffle seed 52993, retries disabled. - Full Studio TypeScript, scoped ESLint, and changed-file Prettier pass. - Behavioral mutation probes detect broken flag guards, finding links, and redirect destinations; source restored afterward. [DEBUG-255](https://linear.app/supabase/issue/DEBUG-255/replace-advisor-terminology-with-issues-throughout-studio) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Jordi Enric <jordi.err@gmail.com> |
||
|
|
3aa85cc774 |
feat(studio): show warning and error counts on the edge function status codes chart (#53171)
## Problem On the edge functions report, the Edge Function Status Codes chart shows a single combined count in its header, which is hard to read when responses include errors. The count would be more intuitive if it were broken down by status code. Resolves FE-4025. ## Solution Add **Warnings** (4xx) and **Errors** (5xx) counts to the right of the total in the chart header. This matches the request cards on the project home page, and uses the same warning and error definitions as the Logs Explorer filters. Per-code detail stays in the legend and tooltip. - The counts show the period totals by default and follow the hovered point, like the total does. - Charts opt in through a new optional `getHeaderStats` on `ReportConfig`, passed through `ReportChartV2` and `ComposedChart` to `ChartHeader`. Only the status codes report sets it, so other reports are unchanged. - The counts are summed from the existing pivoted status code series (`getStatusClassCounts`), so the log queries are untouched and both the BigQuery and otel paths work. - The chart's info tooltip now explains what warnings and errors mean. <img width="756" height="305" alt="Image" src="https://github.com/user-attachments/assets/808085f5-abd9-43ec-903b-dfa0d5e4f598" /> ## Review instructions 1. Run Studio and open **Observability → Edge Functions** for a project that has edge function traffic. 2. On the **Edge Function Status Codes** chart, check that **Warnings** and **Errors** appear next to the total, and that they match the 4xx and 5xx rows in the legend. 3. Hover the chart. The total, Warnings and Errors should all follow the hovered point, then return to the period totals when you move away. 4. Check that **Total Edge Function Invocations**, **Execution Time** and **Invocations by Region** show no Warnings or Errors. 5. Try a narrow viewport to check the header doesn't crowd the buttons. Unit tests cover the counting and the header (period totals, hover, and charts without stats): `pnpm exec vitest run components/interfaces/Reports components/ui/Charts`. ## Checklist Check all before review: - [ ] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [ ] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) |
||
|
|
653dfb7104 |
Fix client crash when landing on new project page (#53206)
## Why it's happening
Opening `/new/[slug]` on the TanStack/Vite dev server crashes with
`TypeError: Cannot read properties of undefined (reading 'from')`. It is
thrown from `.vite/deps/randombytes.js`, inside a `<Lazy>` boundary.
From what I understand it's happening as:
- `lib/project.tsx` imports `generate-password-browser`, which imports
`randombytes`, which imports `safe-buffer`.
- `safe-buffer` calls `require('buffer').Buffer.from`.
- In dev, Vite swaps the Node `buffer` built-in for an empty stub, so
`Buffer` is `undefined`.
Fix is to alias `buffer` to the `buffer` npm package in
`vite.config.ts`, and add `buffer` as a direct Studio dependency.
It's oddly only happening on local but not staging/prod which I'm not
too sure why honestly. Afaict from investigating with Claude, prod
builds already bundle the real `buffer` package, so `Buffer.from` exists
there, but not exactly sure how the build finds it, since nothing in the
repo declared it.
## To test
Only on local:
- [ ] First verify if the client crashes when landing on `/new/[slug]`
- Please let me know if this isn't happening on your end in which case
it might be something on my machine then perhaps
- [ ] Then checkout this branch and verify that client doesnt crash when
landing on `/new/[slug]`
---------
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
|
||
|
|
5f77aa07ea |
fix(studio): keep a cron job's stored command when opening the editor (#53172)
## Problem
The cron job editor could rewrite a job's SQL just by opening it, and
the result depended on how the editor was opened:
- Opened from the jobs list ("..." menu > Edit), the sheet is already
mounted with an empty job. Opening it resets the form to the parsed
values, which re-runs the effect that rebuilds `values.snippet` from the
form fields. The stored command gets replaced by a regenerated one.
- Opened from the job's own page, the sheet mounts with the job, so the
fields don't change on open and the stored command is kept.
The regenerated command is lossy for `net.http_*` calls the HTTP form
can't represent. For example, a header value such as `'Bearer ' ||
(select decrypted_secret from vault.decrypted_secrets ...)` turned into
a literal JSON string, and a chained `|| jsonb_build_object(...)` was
dropped. Saving would silently overwrite a working job.
## Solution
- `parseCronJobCommand` now checks that a `net.http_get` /
`net.http_post` command can be represented by the HTTP form before
parsing it into fields. It needs named arguments only (`url`, `headers`,
`body`, `timeout_milliseconds`), literal values (headers may also be a
single `jsonb_build_object` of literals), and nothing after the call
besides `;`. Anything else (SQL expressions, `||` concatenation, unknown
arguments such as `params`, extra statements) opens as a SQL snippet
with the stored command unchanged. The argument splitter used for
`jsonb_build_object` is generalised and reused for this check.
- `CreateCronJobSheet` keeps the stored command while the form fields
still describe it. It compares the command built from the current fields
with the one built from the parsed stored values. The SQL is regenerated
only after a field actually changes, so both ways of opening the editor
behave the same.
## How to verify
On a project with `pg_cron` and `pg_net` enabled, create a cron job (via
the SQL editor) whose command is a `net.http_post` with headers that use
a SQL expression, for example:
```sql
select cron.schedule('expr-headers', '*/5 * * * *', $$
select net.http_post(
url:='https://example.com/hook',
headers:=jsonb_build_object('Authorization', 'Bearer ' || (select current_user)) || jsonb_build_object('x-fired-at', to_char(now(), 'YYYY')),
body:='{}'::jsonb,
timeout_milliseconds:=5000
);
$$);
```
- Integrations > Cron > Jobs, "..." menu on the job > Edit: the editor
opens as a SQL snippet showing exactly the stored command.
- Click the job row to open its page, then Edit: the editor shows the
same command.
- Edit a simple HTTP job (literal URL and headers) from both places: it
opens in the HTTP request / Edge Function form, and the SQL preview
equals the stored command until a field is changed.
- Change a header value in that simple job: the SQL preview updates to
reflect the change.
Checks run: `vitest run components/interfaces/Integrations/CronJobs`
(new fallback cases in `CronJobs.utils.test.ts`), `pnpm turbo run
typecheck --filter='...[origin/master]'`, eslint and prettier on the
changed files.
[FE-4980](https://linear.app/supabase/issue/FE-4980/fix-cron-job-editor-serialization-different-sql-generated-for-menu-vs)
---------
Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com>
|
||
|
|
8872322a86 |
feat(studio): show issues on the project homepage (#52992)
Show ordered issue cards and open counts on the project homepage behind the issuesInbox flag. |
||
|
|
2ce7f1f33c |
experiment(studio): expanded onboarding survey (#45707)
Adds an optional onboarding survey to the new-organization form, so we
learn who new orgs are for and what they are building. Users in the
`org_form` arm of the `onboardingSurveyPlacement` PostHog flag see a
**Help improve Supabase** section. Users in `control` get today's form
unchanged and still record exposure, so the two arms can be compared;
users the flag doesn't assign get the existing form and record nothing.
**Changed:**
- **Survey on the new-org form**: asks **Who is this org for?** (plus
**How many people?** for companies) and **What are you building?** (AI
assistant or agent, AI search or knowledge base, B2B SaaS, internal
tool, consumer app, social or community, marketplace or booking,
e-commerce, developer tool or app builder, analytics or reporting,
other). Every question ends with **Prefer not to say**. Answers go to
`POST /platform/organizations/onboarding-survey` as `kind`, `size` and
`building`.
- **Follow-up card for a blank survey**: if the creator answers nothing,
a card in the bottom-right asks the same questions for 5 minutes after
the org is created (not on project creation pages). Only the creator
sees it, once, tracked in localStorage. A blank form sends nothing at
creation, because the platform keeps only the first survey response per
user and org. Skipping the card, closing it, or letting the 5 minutes
run out still saves the org type and size picked on the form.
- **Telemetry**: exposure for both arms, plus submit, submit failed,
dismissed (including `follow_up_expired` when the card times out) and
Answer clicked events with `surface` set to `org_form` or `follow_up`.
**Note:** I cut **How comfortable are you working with code?** from v1.
The survey endpoint doesn't accept `coding_experience` yet, and the
question is planned to move to the user level later.
## To test
Setup: override `onboardingSurveyPlacement` to `org_form` in the dev
toolbar. Close the Terms of Service banner first, since the follow-up
card shares its slot.
Tested on the PR preview:
- [x] Create an org with **Who is this org for?** and **What are you
building?** answered, expect one `POST
/platform/organizations/onboarding-survey` carrying `kind` and
`building` (plus `size` for companies), no `coding_experience` key, and
no `kind` or `size` in the org-create request. Observed: 204 with
`{"slug":"<slug>","kind":"COMPANY","size":"10","building":"b2b_saas"}`;
org-create body was `{"name":"<name>","tier":"tier_free"}`
- [x] Create an org with the survey left blank, then open its projects
page, expect the follow-up card; answer it, expect the same survey
request and a "Thanks for sharing" toast. Observed: no survey request at
creation; after answering, 204 with
`{"slug":"<slug>","kind":"PERSONAL","building":"consumer_app"}` and the
toast
- [x] Override to `control`, open the new-org form, expect the same form
as master (Name, Type, Company size with "How many people are in your
company?" for Company, then Plan), no survey section, and an
`onboarding_survey_placement_experiment_exposed` event with `variant:
control`. Observed: screenshots match master's form field for field; the
exposure arrived in PostHog with `variant: control`
- [x] Create an org with the survey left blank and don't act on the
follow-up card for 5 minutes, expect the card to disappear, one `POST
/platform/organizations/onboarding-survey` carrying the form's `kind`
(plus `size` for companies) and no `building`, and an
`onboarding_survey_dismissed` event with `reason: follow_up_expired`.
Observed (stored follow-up time moved to near expiry instead of
waiting): the card disappeared at the 5-minute mark with one 204
carrying `{"slug":"<slug>","kind":"AGENCY"}` and the `follow_up_expired`
event; an already-expired follow-up sends on page load; with the dialog
open past expiry nothing is sent until it is closed
## Linear
- fixes GROWTH-771
- part of GROWTH-1463
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Jonathan Summers-Muir <MildTomato@users.noreply.github.com>
Co-authored-by: Pamela Chia <pamelachiamayyee@gmail.com>
Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
|
||
|
|
797a43c7d0 |
feat(studio): add a shared shield badge to identity verification (#53145)
## Problem The authenticator and recovery-code verification screens use the plain Supabase logo, while other security interstitials use a badge to show the purpose of the screen. ## Solution Add the same shield with a cut-out check to **Verify your identity** and **Use a recovery code**, using `InterstitialLogoBadge`. | After | | --- | | <img width="942" height="456" alt="CleanShot 2026-11-09 at 18 02 09@2x" src="https://github.com/user-attachments/assets/6e19eb79-7b42-4f95-967d-479ca38cc347" /> | | _Note the grey “Shield with cut-out check” for verification interstitials like this one._ | | <img width="1016" height="454" alt="CleanShot 2026-11-09 at 10 35 46@2x" src="https://github.com/user-attachments/assets/dca51146-c7ee-44fd-a318-ef7101f1c77f" /> | | _No visual changes here, just showing the family of badges._ | ## Review instructions 1. On [Security on this preview](https://studio-staging-git-dnywh-verification-shield-badge-supabase.vercel.app/dashboard/account/security), follow [#52352’s breakpoint steps](https://github.com/supabase/supabase/pull/52352#review-instructions) with a disposable MFA account that has recovery codes. Check for the shield in the top-right corner of the Supabase logo. 2. Choose **Use recovery code instead**. Check that the same badge appears on the recovery-code screen. |
||
|
|
c6a9401801 |
fix(studio): standardise interstitial logo badges (#52748)
## Problem Interstitial logo badges use custom sizes and scaling. This becomes brittle as we extend the amount of icons beyond just those in Admonition. ## Solution Share a standard 20 px badge with a 14 px icon with the new `InterstitialLogoBadge`. Apply it to the _Secure your account_ interstitial. This `InterstitialLogoBadge` will be used with a `shield-check` like icon for the one-time password interstitial. | After | | --- | | <img width="1016" height="454" alt="CleanShot 2026-11-09 at 10 35 46@2x" src="https://github.com/user-attachments/assets/dca51146-c7ee-44fd-a318-ef7101f1c77f" /> | | _See the orange badge; this is now served via `InterstitialLogoBadge`. No visual changes._ | ## Review instructions 1. With a spare or disposable staging account: open [Account Security on this preview](https://studio-staging-git-dnywh-interstitial-logo-badge-supabase.vercel.app/dashboard/account/security). Set the following conditions: - Has one MFA method - Has no recovery codes (you might need to delete these) 3. Navigate to any other Studio page (you can just tap _Back to dashboard_). Assuming you haven’t snoozed a reminder recently (see local storage), you should land on _Secure your account_ interstitial. 4. Check the warning badge overlaps the Supabase logo cleanly in light and dark mode. |
||
|
|
a93a3a78f5 |
feat(studio): clarify configured sign-in methods (#52356)
## Problem In Account Preferences, the option to add a password looks like an email sign-in method that is already set up. ## Solution - Make configured sign-in methods easier to scan, with consistent rows, icons and edit controls. - Put **Add password** above the list as a separate suggestion. If GitHub is your only way to sign in, explain how a password gives you a backup. The Email row appears after you set a password. This PR updates the existing section in Preferences and can merge on its own. #52358 moves the section to Security and decides which action to emphasise across sign-in, MFA and recovery codes. | After | | --- | | <img width="744" height="294" alt="Security Account Supabase" src="https://github.com/user-attachments/assets/f11d102f-58a3-4d8b-88fd-d03b51b40c0f" /> | | _User with GitHub only._ | <img width="1442" height="484" alt="CleanShot 2026-11-09 at 13 09 00@2x" src="https://github.com/user-attachments/assets/885537d3-6b01-47dc-95f9-d545b7f8f249" /> | | _When a user has both GitHub and email sign-in, and a password attached to that email address._ | | <img width="1432" height="390" alt="CleanShot 2026-11-09 at 13 08 43@2x" src="https://github.com/user-attachments/assets/f2d6f635-43f9-47ea-92cd-09d6c216f7bd" /> | | _SSO user._ | ## Review instructions 1. Open [Sign-in methods](https://studio-staging-git-dnywh-recovery-signin-polish-supabase.vercel.app/dashboard/account/me#sign-in-methods) with an OAuth-only test account. Check the password suggestion sits above the configured methods. 2. On a disposable account, add a password. Check the Email row appears and the email-edit tooltip opens above its button. Linking a provider should still return you to Preferences. --------- Co-authored-by: Joshen Lim <joshenlimek@gmail.com> |
||
|
|
f87de2f0d0 |
Joshenlim/fe 4593 cmd k related resources while in table editor (#53079)
## Context Building on towards resource-aware Cmd K, the changes done up so far have all been to allow users to search for database resources from anywhere in the project, with the intention to get you to the resource quickly without having to go through the navigation hierarchy of the dashboard. This PR explores a way to quickly glance related resources for a table in the Table Editor through Cmd K for that same intention, but listing out the policies, triggers or functions that run on the table that you're currently viewing in the Table Editor. E.g here we've got the `blog_authors` table opened: <img width="500" alt="image" src="https://github.com/user-attachments/assets/78c9b85f-cd30-4564-a264-c1a2a596d5c2" /> Policies and triggers are fairly straight forward since we can determine what's related by their target table. Functions are a bit more fuzzy as we're trying to find what's related by checking the function definition, if it does anything to the table. For e.g based on the screenshot above, `blog_handle_new_user` has this definition which was why it was flagged <img width="500" alt="image" src="https://github.com/user-attachments/assets/fb8f3be4-05df-4d87-8440-8b75d95546ae" /> We're also deliberately decoupling loading of policies + triggers and functions since searching functions takes slightly longer, so opting to load results of policies + triggers first, then lazy load functions subsequently once results are ready ## Performance As usual, ran a benchmarking session with Claude just to make sure that the added SQL doesn't cause any performance issues, these are aggregates of 4–5 runs. **Catalog size (stress catalog)** | Query | 2,000 tables | 10,000 tables | |---|---|---| | Policies and triggers, hub table (many FKs) | 0.1 ms | 0.5–1.3 ms | | Policies and triggers, ordinary table | ~0 ms | ~0 ms | | Functions, every body matches | 1.4 ms | 4–8 ms | | Functions, no match (full scan) | 1.8 ms | 7.3–7.7 ms | | Functions, table not visible | 0 ms | 0 ms | **Large function bodies** (random text, 2,000 tables plus 2,000 small functions, plus the large ones added) | Function source | Largest function | Functions: no match (full scan) | Functions: every body matches | |---|---|---|---| | 56 MB (600 functions) | 94 KB | ~50 ms | 2 ms | | 103 MB (+10 multi-MB) | 4.7 MB | ~92 ms | 2 ms | ## To test Use a project with a table that has at least one policy, one trigger, and a function that mentions the table in its body. - [ ] Open that table in the Table Editor and press Cmd+K. A **Related resources** section appears at the top with its policies, triggers, and functions. - [ ] Click a policy, a trigger, and a function. Each opens its editor on the right resource. - [ ] A trigger's function does not also appear under the functions rows. - [ ] Type part of one of those names. The section narrows to matching rows and the project-wide entity results appear below. A resource can appear in both. - [ ] Type something that matches nothing in the table. The section disappears rather than showing empty. - [ ] Clear the input. The full section comes back without a loading flicker, since the data is cached. - [ ] Open the table editor on a table with no policies, triggers, or referencing functions. Cmd+K shows no empty **Related resources** section. - [ ] Switch to a different table and press Cmd+K. The section shows that table's resources, not the previous table's. - [ ] Open Cmd+K from a non-Table Editor page, such as the SQL Editor. The section is not shown. - [ ] In the network tab, check that opening the menu sends one query for policies and triggers and one for functions. Typing sends no additional ones for this section. |
||
|
|
3a76beea91 |
feat(studio): classify fetch-layer errors with endpoint and method (#53048)
## Problem Follow-up to #52730. Resolves part of FE-4772. Fetch failures and aborts were classified as `UnexpectedError`, and HTTP error responses with empty, HTML, or plain-text bodies did too. ## Solution **Network failures and aborts keep their classification.** `fetchHandler` used to rewrite `Failed to fetch` into a plain `Error`, so openapi-fetch network failures were classified as `UnexpectedError`. It now throws `classifyError(err, { endpoint, method })`, giving `NetworkUnreachable` (same user-facing message, original error as `cause`) or `RequestAborted`. The endpoint comes from `schemaPath`, recorded in `onRequest`. Tagged aborts are no longer named `AbortError`, so `isRequestAborted()` checks for both. `state/storage-explorer.tsx` uses it, so cancelling a folder load no longer shows an error toast. **One place reads error responses.** `readResponseError` in `data/error-classification.ts` turns an HTTP error response into a `RawResponseError`. It reads the status, `Retry-After`, the message from a JSON body or a short `text/plain` body (never HTML), plus `requestId`, `endpoint`, and `method`. The openapi-fetch middleware serializes its result into the error body. openapi-fetch builds `error` only from the response body, so that step can't be skipped. `parseResponseErrorBody` now only checks the shape. Empty, HTML, and plain-text error bodies now classify by status. Before, they became `UnexpectedError`. `fetchGet`/`fetchPost`/`fetchHeadWithTimeout` (Studio's own `/api` routes) use the same helper. This also fixes a non-JSON error body making them reject with a `SyntaxError`. **`requestPathname` is replaced by `endpoint`.** The no-retry list and the statement-timeout check in `query-client.ts` match OpenAPI patterns exactly. Critical error messages in `lib/error-reporting.ts` use the pattern, so concrete project refs stay out of them. `path-to-regexp` is no longer used, so it's removed. ## Review instructions 1. From `apps/studio`, run `vitest run data lib components/interfaces/ErrorHandling state`. Expect 4,034 passing tests. 2. Review `readResponseError` in `data/error-classification.ts` and its use in `data/fetchers.ts`. ## Additional context ### Notes - Critical error messages now read `endpoint … w/ message: …`. This regroups those Sentry issues. - A JSON body's `error` string is now accepted as a message for API responses. Before, only the `/api` route path read it. ### Testing - New `data/fetchers-errors.test.ts` covers network failure, abort, empty/HTML/plain-text/JSON error bodies, service derivation, and `/api` route non-JSON bodies. - Unit tests for `readResponseError`, `isRequestAborted`, and the no-retry endpoint set. - `vitest run data lib components/interfaces/ErrorHandling state`: 4,034 pass. ## Checklist Check all before review: - [ ] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [ ] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) |
||
|
|
f314e6dc19 |
feat(studio): one click attribute filters in the unified logs overview panel (#53170)
## Problem Filtering via properties in the Overview tab of Unified Logs had a couple of clicks to it. ## Solution Attribute rows now expose equals and not-equals directly, through one shared code path. - **Hover devices** (`(hover: hover) and (pointer: fine)` above `md`): hovering or keyboard-focusing a row reveals borderless icon buttons at its right edge — equals, not equals, copy — following the same reveal pattern as the "Only" button on the sidebar filters. The value fades out behind them so nothing is occluded or reflowed. - **Touch devices and small viewports**: unchanged dropdown, now listing "Filter: equals", "Filter: not equals" and "Copy <attribute>" instead of the single "Add filter". - Only rows that can actually be filtered get filter actions; everything else gets copy alone. | Before | After | |--------|--------| | <img width="451" height="191" alt="Screenshot 2026-11-09 at 16 12 08" src="https://github.com/user-attachments/assets/ffc68a34-4373-44ea-8922-8f5b3dd436a0" /> | <img width="465" height="148" alt="Screenshot 2026-11-09 at 16 12 25" src="https://github.com/user-attachments/assets/0bf41014-25d7-4390-ba5f-ab7a796ec1de" /> | ## Review instructions 1. Open the preview, go to a project's Logs, and click a log row to open the detail dock on the Overview tab. 2. Hover a filterable row (Path, Method, Status, or any attribute). Equals, not-equals and copy buttons fade in at the right edge; the value fades out. Tab into them to check the focus rings and tooltips. 3. Click the equals button on Path. The filter appears in the filter bar and the log list updates. Do the same with not-equals on another row and confirm the chip uses `<>`. 4. Hover a row that can't be filtered (for example Host or Client). Only the copy button appears, and no filter action is offered. 5. Apply the same filter twice — no duplicate chip. Then apply the opposite operator on that column — the chip's operator is replaced rather than mixed. 6. Narrow the window below 768px (or use a touch device). The hover buttons disappear and clicking a row opens the dropdown with "Filter: equals", "Filter: not equals" and "Copy <attribute>". |
||
|
|
5b09806690 |
fix(studio): apply Studio error policy on the TanStack server (#53174)
Part of FE-4772. Follow-up to #53059. ## Problem #53059 made `beforeSend` drop `UserSqlError` and redact `StudioSqlError`, and added that hook to `sentry.server.config.ts`. Only the Next build loads that file. Production runs the TanStack Start build, which initializes server Sentry in `instrument.server.mjs` with no `beforeSend`. ## Solution - **`buildSentryServerOptions`** (`lib/sentry-server-options.ts`) holds the shared server options: DSN, environment, trace sample rate, `ignoreErrors`, and `beforeSend` calling `applyStudioErrorPolicy`. It mirrors `buildSentryClientOptions` on the client. - **All three server inits use it:** `sentry.server.config.ts` (Next, Node), `sentry.edge.config.ts` (Next, edge), and `instrument.server.mjs` (TanStack, Nitro). The TanStack init passes the commit SHA as `release`. Next leaves it unset so the release from `withSentryConfig` still applies. - **The edge runtime now gets `beforeSend`** and the full `ignoreErrors` list, which it didn't have before. - `instrument.server.mjs` imports the builder by relative path. Studio's tsconfig doesn't include `.mjs` files, so the `@/` alias may not resolve there. ## Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) |
||
|
|
2c871b42b7 |
fix(studio): show OAuth app client secret in a blocking modal (#53167)
## Problem After creating a confidential OAuth app or regenerating its client secret, the credentials appeared in a small dismissible banner above the apps table. The secret can't be retrieved again, so a missed banner meant regenerating the secret and breaking existing integrations. ## Change - Replace `NewOAuthAppBanner` with `NewOAuthAppModal`, following the pattern of the S3 access key `CreateCredentialModal`. - The modal shows the client ID and client secret with copy buttons and states the secret won't be shown again. - It can only be closed with Done. Outside clicks, Escape and the close button are blocked. - Public apps (no client secret) and plain edits behave as before: no modal. - Create and both regenerate entry points (row menu and sheet) feed the same modal, so no data-layer changes. Step 1: <img width="420" height="251" alt="Image" src="https://github.com/user-attachments/assets/74430837-90fd-49e9-9441-234abc97588a" /> Step 2: <img width="420" height="375" alt="Image" src="https://github.com/user-attachments/assets/92ab3786-8bd1-46cf-a4b4-b2643f288e65" /> ## Testing - Added `NewOAuthAppModal.test.tsx`: credentials and warning render, no modal for public or missing apps, only Done dismisses. - Manual: Authentication → OAuth Apps → create a confidential app, and regenerate from the row menu and the sheet. Closes #53116 Linear: FE-4976 |
||
|
|
d7f2b501b5 |
feat(studio): add the issue detail page (#52991)
Add issue details, affected resources, and copy actions with coverage for secondary checks and clipboard outcomes. |
||
|
|
e04c556bd5 |
feat(studio): add the issues list (#52990)
Add the Issues list, URL filters, and overview counts with complete advisor refresh handling. |
||
|
|
c0e92057a6 |
feat(studio): split SQL errors into user and Studio SQL (#53059)
Part of FE-4772. ## Why Errors from the pg-meta query endpoint didn't say who wrote the SQL, so a Sentry issue like SUPABASE-APP-KXE couldn't tell a user's query from one Studio composed. That event came from the assistant's `execute_sql` tool and was captured by the Vercel AI integration on the server, so it skipped `reportStudioError` and had no fault tags. The Postgres message also went to Sentry as-is, and it can contain user SQL and data. ## What - **`sqlOrigin` is required on `executeSql`.** `'user'` covers SQL the user or an AI agent wrote, in whole or in part: SQL editor, editor panel, Explorer, AI `execute_sql` and `run_notebook`, report blocks, Query Insights EXPLAIN, the policy, function, and cron editors, and running a stored cron job. Everything else is `'studio'`. The policy, function, and cron mutation hooks and `useDbQuery` take `sqlOrigin` too. - **`classifySqlResponseError`** turns a 400 from the query endpoint into `UserSqlError` (`user`, `user_sql`) or `StudioSqlError` (`studio`, `studio_sql`). Pattern rules (connection timeouts) and other statuses keep their classes. - **`UserSqlError` never reaches Sentry.** Its routing is `SAMPLE_NEVER`, `alwaysCapture` doesn't override it, and `beforeSend` drops it. - **`StudioSqlError` is redacted.** Error classes can set `sentryMessage`; for `StudioSqlError` it is the SQLSTATE and the query's `queryName`, a static name that `executeSql` requires for Studio SQL. The query key is never reported, since its segments can hold IDs, schemas, and search terms. `applyStudioErrorPolicy` applies it from `beforeSend` on the client and the server, so it holds however the error was captured. The server config gets a `beforeSend` for this. Events get `query_name` and `sql_state` tags and are grouped by both, since every SQL error shares the `executeSql` stack. - **A custom `handleError` gets the classified error**, matching its declared type. The SQL editor, editor panel, and policy editor rethrow it, so their errors are now `UserSqlError` instead of being reported as `UnexpectedError`. The error keeps Postgres's `position` for the editor's line highlight. The error message, `formattedError`, and `position` stay on the error for the UI. The query-performance Sentry context no longer carries the raw error message, which bypassed redaction. ## Known gaps - Index advisor queries run users' query text from `pg_stat_statements` but are marked `'studio'`. Redaction keeps the text out of Sentry, but their failures count as Studio faults. - 5xx responses for user SQL are still `PlatformError` and keep their message. - The self-hosted MCP `executeSql` calls `executeQuery` directly and isn't covered. ## Testing - Unit tests for `classifySqlResponseError`, `applyStudioErrorPolicy`, and the client `beforeSend`. - Full Studio vitest suite passes except `useReportDateRange.test.ts` (169 vs 168 hourly buckets across the DST change), which this PR doesn't touch. |
||
|
|
011b7cd4ac |
feat(studio): derive issues from advisor lints (#52989)
Part 1 of 6: #52989 → #52990 → #52991 → #52992 → #52993 → #53138 Advisors becomes Issues. This PR maps lints to issues on the client: one issue per check, each lint an affected resource, plus one issue for banned IPs. There's no Issues API yet, so issues exist only while their check fails. Nothing renders them until #52990. ## How to test - Read `data/issues/lint-to-issue.ts`; the rest follows from it. - `pnpm --filter studio exec vitest run data/issues components/interfaces/Issues` --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Jordi Enric <jordi.err@gmail.com> |
||
|
|
4c68610167 |
feat(studio): copy large values when duplicating a row (#53091)
## What Follow-up to #52952. The grid truncates large columns (over 10 KB) in the database query, so \"Duplicate row\" used to leave those fields blank. It now fetches their full values and fills them into the Insert Row panel. ## Behavior - Truncated columns are fetched by primary key after the panel opens. Each one is disabled with \"Loading full value...\" until it arrives, and Save is disabled until every value has settled. Submitting the form another way (e.g. pressing Enter) is blocked too. - Only the truncated fields are filled in, so anything the user has edited is never overwritten. - If a value can't be copied, the field stays empty with a note saying why: - the value is over 1 MB (it isn't sent, so a single row can't pull an unbounded amount of data into the browser) - the table has no primary key - the fetch failed (also shows a toast) - The fetch honors \"View as role\", like the existing \"Load full\" buttons. ## How - New `useRowLargeValuesQuery` in `data/table-rows/` selects the truncated columns of one row in a single query. Each column is returned as `NULL` when it exceeds `MAX_ROW_LARGE_VALUE_BYTES`. The SQL is built with `ident()`, `literal()` and the Query builder. - A new `useCopiedLargeValues` hook owns the fetch and per-field status, to keep `RowEditor` from growing further. Pure helpers (`getTruncatedFieldNames`, `getPrimaryKeyMatch`, `mergeLargeValues`) are in `RowEditor.utils.ts`. - `InputField` takes an optional `status` and renders the note. ## Also changes `isValueTruncated` now compares byte length instead of character length. The query truncates when a value exceeds the limit in bytes but cuts by characters, so a value of multibyte characters could be truncated and still be shorter than the limit in characters, and wasn't detected. Comparing bytes still never flags a genuine value, because an untruncated value is at most the limit in bytes. Edit row's \"Load full\" buttons benefit from the same fix. ## Notes - A fetched value over 10 KB that genuinely ends in `...` still looks truncated to the existing check, so the form disables that field, as it already does when editing such a row. - A column that changed to `NULL` after the grid loaded also shows the \"too large\" note. ## Testing - Unit tests for the SQL builder (including identifier and literal escaping), the byte-aware detection, and the new helpers. - Component tests for `RowEditor`: the full value is fetched and included in the insert; field and Save are disabled while loading (including form submit); too large, fetch failure, and no primary key leave the field empty with a note; nothing is fetched when no value was truncated. I confirmed the loading test fails when the Save guard is removed. Resolves FE-4927 |
||
|
|
8fb806a2b2 |
feat(studio): place account security below preferences (#51642)
## Problem Security is separated from Preferences in the account sidebar. ## Solution Place Security directly below Preferences. ## Review instructions 1. Open [Account Security](https://studio-staging-git-dnywh-account-recovery-ux-supabase.vercel.app/dashboard/account/security). 2. Confirm Security sits directly below Preferences and both links open the correct page. |
||
|
|
5cf3cf1032 |
feat(studio): make security the home for sign-in and recovery setup (#52358)
## Problem - Sign-in methods are in Preferences, separate from MFA and recovery settings. - The risk of a single sign-in method (e.g. GitHub, and getting locked out of that account) isn’t clearly communicated. ## Solution - Bring sign-in methods, MFA and recovery codes together on the Security page. If Security is disabled, sign-in methods remain accessible in Preferences. - Highlight the most important next step with a primary button. For example, when MFA is off, “Set up MFA” takes priority over adding a password. - Explain the risk of relying on a single sign-in provider, and make it clear which email address a new password will apply to. - After connecting a sign-in provider, return users to the settings page they can access. Links to password setup open the password dialog directly. | After | | --- | | <img width="1460" height="1426" alt="CleanShot 2026-11-06 at 14 54 23@2x" src="https://github.com/user-attachments/assets/afb82601-1b6f-43be-9e98-a0edb8d529c8" /> | | _The “Sign-in methods” section moved to Account → Security. Note also the new Admonition regarding the risk of a single (GitHub) sign-in method._ | ## Review instructions 1. Open [Security](https://studio-staging-git-dnywh-recovery-security-home-supabase.vercel.app/dashboard/account/security#sign-in-methods). Check sign-in methods appear above MFA and recovery codes. With MFA off, “Set up MFA” should be primary. 2. Open Preferences. Sign-in methods should be absent unless Security is disabled. 3. On a test account, check password setup, email editing and provider linking. [Open password setup directly](https://studio-staging-git-dnywh-recovery-security-home-supabase.vercel.app/dashboard/account/security?securityAction=set-password#sign-in-methods), then cancel and confirm it stays closed. |
||
|
|
b83ad78d77 |
feat(studio): show recovery code health in account security (#52355)
## Problem Users can run out of recovery codes without a clear warning that they have lost a backup way to sign in. ## Solution Show a warning when codes are running low or used up, with Regenerate beside the code count. When MFA is enabled but codes are missing, explain how to generate them. Keep recovery codes hidden until MFA is enabled. Remove standalone code deletion. Users can regenerate codes while MFA is enabled. | Before | After | | --- | --- | | <img width="1024" height="682" alt="Security Account Supabase" src="https://github.com/user-attachments/assets/1c7a4c52-00c9-4c31-8b3a-ef0599555a1a" /> | <img width="1024" height="682" alt="81082" src="https://github.com/user-attachments/assets/ae662802-4fab-4c93-a5cb-52ed39d16f87" /> | | _3/10 codes left._ | _3/10 codes left._ | | <img width="1024" height="682" alt="21450" src="https://github.com/user-attachments/assets/82049f44-2fca-4477-84bf-23ab009868be" /> | <img width="1024" height="682" alt="Security Account Supabase" src="https://github.com/user-attachments/assets/e2185026-af6a-42a5-bc10-b587e3d2d4ab" /> | | _0/10 codes left._ | _0/10 codes left._ | ## Review instructions 1. Open [Recovery codes](https://studio-staging-git-dnywh-recovery-code-health-supabase.vercel.app/dashboard/account/security#recovery-codes) with one authenticator and generated codes. 2. In DevTools, override GET `/factors/recovery-codes`: keep the other fields, set `remaining` to `0`, save and reload. Check the warning. Repeat with `3`, then restore the response. 3. With MFA off, check that the Recovery codes section is hidden. Disable overrides before using Regenerate. |
||
|
|
52cc917752 |
feat(studio): clarify authenticator setup and backup status (#52354)
## Problem MFA setup and backup status are difficult to scan, and unverified factors can appear as configured authenticators. ## Solution - Show only verified authenticators (non-abandoned setup), with a clear setup state when none are configured. - Show backup guidance from the shared recovery checks and emphasise the most relevant MFA action once those checks succeed. - Align authenticator rows with the existing controls, use removal icons with tooltips, and prevent removal when recovery-code status cannot be confirmed. | Before | After | | --- | --- | | <img width="1024" height="759" alt="7693" src="https://github.com/user-attachments/assets/1deb07ef-91ce-481b-87f6-4baa7b023f94" /> | <img width="1024" height="759" alt="18215" src="https://github.com/user-attachments/assets/f17248a2-2001-4d95-ba28-3f16b75af0fb" /> | | <img width="1024" height="759" alt="Security Account Supabase" src="https://github.com/user-attachments/assets/ede61c84-0baa-4139-9773-0953a05cbd94" /> | <img width="1024" height="759" alt="14038" src="https://github.com/user-attachments/assets/58ab1a70-0392-4706-8df3-2ba078c5a8ba" /> | ## Review instructions 1. Open [MFA settings](https://studio-staging-git-dnywh-recovery-mfa-status-supabase.vercel.app/dashboard/account/security#mfa) without a verified authenticator. Confirm the setup empty state offers “Set up MFA”. 2. Use an account with one authenticator and healthy codes. Check the backup warning, aligned icon row, and remove tooltip. ## Validation 14 focused tests passed, including Auth SDK network responses and failed recovery-status reads keeping removal unavailable. Formatting passed. Focused ESLint passed with the locally incompatible TanStack exhaustive-deps rule disabled; standard lint is blocked by the installed plugin rejecting the current rule options. Full local typecheck still reports errors in untouched panel and MCP files; none remain in this PR's changed files. |
||
|
|
c7b49e2b1b |
feat(studio): resume account actions after recovery-code verification (#52747)
## Problem Recovery-code verification uses a separate sign-in layout and returns users to Security without resuming the selected action. ## Solution Visually align with other security checks: use InterstitialLayout and return to the selected authenticator’s removal confirmation. Cancel returns to Security without signing out. Verification never removes the authenticator automatically. | Before | After | | --- | --- | | <img width="1280" height="1323" alt="Supabase" src="https://github.com/user-attachments/assets/404e7b6d-6fe6-492a-b853-dc3b13b8f767" /> | <img width="1280" height="1323" alt="47214" src="https://github.com/user-attachments/assets/0100cf2f-3252-4f5c-a3a6-17bb0d81dfa5" /> | | After | | --- | | <img width="1280" height="1323" alt="45032" src="https://github.com/user-attachments/assets/584254e2-0772-4dae-a0e5-9be6a8f99239" /> | | _Loading state._ | | <img width="1280" height="1323" alt="8565" src="https://github.com/user-attachments/assets/6d14459d-f172-4338-a021-fb5721649fda" /> | | _Standard unfilled state._ | | <img width="1280" height="1323" alt="47304" src="https://github.com/user-attachments/assets/83eca080-0fb6-4b3e-a52b-0110c6f8714a" /> | | _Error state. I’ve removed `font-mono` since this screenshot._ | This PR also includes the _Use recovery code instead_ option into the prior PR’s _Verify your identity_ interstitial: | After | | --- | | <img width="1280" height="763" alt="6526" src="https://github.com/user-attachments/assets/a05e3bc5-061d-4297-9fd0-e456dba44d4a" /> | | _Addition of the _Use recovery code instead_ button._ | ## Review instructions Use a disposable MFA account with saved recovery codes. Successful verification consumes one code. 1. Open [Security on this preview](https://studio-staging-git-dnywh-recovery-code-verification-supabase.vercel.app/dashboard/account/security). Follow [#52352’s breakpoint steps](https://github.com/supabase/supabase/pull/52352#review-instructions) on this preview to show Verify your identity. Remove the breakpoint before continuing. 2. Choose Use a recovery code instead. Check the code visibility control and an invalid-code error, then enter a valid saved code. The selected authenticator’s removal confirmation should open. Nothing is deleted until you click Remove. 3. Repeat and Cancel on the recovery-code screen. Return to Security and remain signed in. --------- Co-authored-by: Joshen Lim <joshenlimek@gmail.com> |
||
|
|
1052d414ad |
fix(studio): verify identity before removing authenticators (#52352)
## Problem Authenticator removal can fail when the session has not completed MFA. This is difficult to test (see below) but shows an awkward toast with unclear “AAL1” and ”AAL2” copy, which is unhelpful to the user. ## Solution Checks the session before removal confirmation. If needed, shows _Verify your identity_ first. Depends on #52351. Badge presentation: #52748. Recovery-code verification: #52747. | After | | --- | | <img width="814" height="725" alt="Security Account Supabase" src="https://github.com/user-attachments/assets/8d0dc002-3777-4ba5-a4bc-9d98a059c2c4" /> | | _Unfilled state._ | | <img width="814" height="725" alt="63727" src="https://github.com/user-attachments/assets/5472de19-99b6-4403-aaca-f92e319445cb" /> | | _Errored state._ | | <img width="814" height="725" alt="27157" src="https://github.com/user-attachments/assets/f8480f0b-5cc4-432f-b38f-79cd311274cf" /> | | _What the above (success state) unlocks: being able to remove authenticator._ | ## Review instructions Use a disposable MFA account and sign in normally. 1. Open [Security locally](http://localhost:8082/account/security) (so the breakpoint feature can be used). Click Delete beside an authenticator. Since you already entered an MFA code at sign-in, removal confirmation should open directly. Cancel keeps the authenticator. Click Cancel. 2. To show verification, open DevTools → Sources → ⌘P. Find `mfa-authenticator-assurance-level-query.ts`. Inside `getMfaAuthenticatorAssuranceLevel`, click the line number beside **`return data`** to add a breakpoint, then (back in the Studio interface) click Delete. 3. When Paused in debugger appears, press Esc for the Console drawer (in DevTools) and run `data.currentLevel = 'aal1'`. Remove the breakpoint by clicking its line number again, then press F8 or Resume ▶ (at the top of Studio in the yellow strip). 4. Try an invalid authenticator code, then a valid one. Verification must lead to a separate removal confirmation. Cancel must keep the authenticator. --------- Co-authored-by: Joshen Lim <joshenlimek@gmail.com> |
||
|
|
ed03223f5a |
fix(studio): preserve authenticator removal progress on failure (#52351)
## Problem Failed authenticator removal shows a toast and can repeat completed steps on retry. A failed recovery-code status check can also allow removal before Studio knows whether codes exist. ## Solution Show errors below the dialog content, preserve removal progress on retry, and block removal until recovery-code status is known. Add Retry for failed status checks. | After | | --- | | <img width="1450" height="458" alt="CleanShot 2026-11-04 at 15 34 41@2x" src="https://github.com/user-attachments/assets/98989ad0-9b43-4203-95e4-1767346f2a8e" /> | | _Retry action._ | | <img width="1514" height="246" alt="CleanShot 2026-11-04 at 15 16 37@2x" src="https://github.com/user-attachments/assets/969b6525-c380-4a8a-9826-58bfe04887f8" /> | | _Blocked `recovery-codes` means user cannot delete MFA._ | | <img width="1088" height="1040" alt="CleanShot 2026-11-04 at 15 18 08@2x" src="https://github.com/user-attachments/assets/08e6631f-e90e-4719-bd0b-6360d5871d48" /> | | _If `recovery-codes` becomes unavailable after dialog is open, show the error inline (not as a toast)._ | ## Review instructions Use a disposable MFA account with recovery codes. Successful removal deletes the authenticator and, if it was the last, its codes. 1. Open [Security](https://studio-staging-git-dnywh-recovery-removal-errors-supabase.vercel.app/dashboard/account/security). In DevTools Network, right-click GET `/factors/recovery-codes` → Block request, then reload. Confirm removal is disabled. Unblock and click Retry to enable it. 2. Open the removal dialog, then block the same request without reloading. Click Remove: the error should appear below the content. Unblock and retry: removal should succeed. |
||
|
|
156738417b |
fix(studio): centre the account recovery interstitial (#53073)
## Problem The account recovery interstitial sits too high on tall screens because it overrides the shared layout with fixed top padding. ## Solution Use the shared interstitial layout's vertical centring for the reminder, loading and unavailable states. | Before | After | | --- | --- | | <img width="1451" height="957" alt="69167" src="https://github.com/user-attachments/assets/b473a983-93a9-4c57-866c-5ce6dd02dddf" /> | <img width="1280" height="1323" alt="Organizations Supabase" src="https://github.com/user-attachments/assets/fe0af974-36fb-4edf-adfd-abfa75c22038" /> | ## Review instructions 1. Use this PR's **[studio-staging](https://studio-staging-git-dnywh-fixrecovery-interstiti-efb132-supabase.vercel.app/)** preview with `enableAccountRecoveryInterstitial` and `enableAuthRecoveryCodes` enabled. Sign in with a non-SSO test account that has MFA but no recovery codes, and complete MFA verification. 2. If the account has previously skipped the reminder, remove its `account-recovery-reminder:<user-id>` entry from local storage on this preview origin, then reload. 3. Open `/dashboard/organizations` The reminder appears over the dashboard after its background checks finish. Confirm the card is vertically centred on a tall desktop viewport. 4. Use a narrow viewport, a short viewport and 200% browser zoom. Confirm all content and **Skip for now** remain reachable by scrolling when needed. Skip rather than generating codes if you do not want to change the test account. |
||
|
|
9f351563a9 |
fix(studio): prevent column comment data loss from sensitivity marker (#53051)
## What Studio stores a column's "sensitive data" flag in-band by adding `[SENSITIVE]` to the column's comment. The encode/decode helpers matched the marker **anywhere** in the string, which caused two problems: * A comment that merely *contains* `[SENSITIVE]` (e.g. `Fields marked [SENSITIVE] are PII`) was wrongly treated as sensitive. * The marker was stripped from the **middle** of the user's text on save - even when the sensitivity toggle was off - silently corrupting user-authored content. Discussion: https://github.com/orgs/supabase/discussions/52699 ## Changes Following the direction in the discussion: 1. **One shared helper** - the marker logic was duplicated in three places (`ColumnEditor.utils.ts`, `state/table-editor-table.tsx`, and the toggle in `TableEditor/Column.tsx`), each slightly different. These are consolidated into a single `lib/sensitive-column-comment.ts` with `isSensitiveComment` / `encodeSensitiveComment` / `decodeSensitiveComment`. 2. **Prefix-anchored detection and removal** - the marker is only matched and stripped when it's an exact leading prefix (plus at most one following space), so a mid-string `[SENSITIVE]` is preserved verbatim. 3. **Standardized the marker position** - `Column.tsx`'s toggle previously appended the marker to the *end* of the comment, while the column editor prepended it. The toggle now writes the canonical prefix, so detection is consistent across all paths. 4. **Backward compatibility** - to avoid losing the flag on columns that were saved with a *trailing* marker (the old toggle behavior), `decodeSensitiveComment` also recognizes and strips an existing trailing marker. Re-saving such a column migrates it to the prefix form. ## Example ```ts // Before encodeSensitiveComment('a [SENSITIVE] b', false) // -> 'a b' (data loss) // After encodeSensitiveComment('a [SENSITIVE] b', false) // -> 'a [SENSITIVE] b' (preserved) ``` Tests Added lib/sensitive-column-comment.test.ts covering the encode/decode round trip, the mid-string case, the bare-marker case, and legacy trailing-marker migration (16 cases). Note for reviewers Point 4 (decoding a legacy trailing marker) is the one behavior I'd like a sanity check on.... it's there so columns already flagged via the old grid toggle don't silently lose their flag after this change. Happy to drop it if you'd prefer to keep decode strictly prefix-only. |
||
|
|
c920e07d9c |
feat(studio): review a pending network restrictions change (#52984)
## Problem A network restrictions change that was never applied can now wait for the customer's review ([API Docs](https://api.supabase.com/api/v1#tag/projects/POST/v1/projects/{ref}/network-restrictions/review), [CTRL-1934](https://linear.app/supabase/issue/CTRL-1934)). Studio doesn't show it. Lists with an entry that isn't a valid IP range also fail to save without saying which entry is wrong. ## Solution - A change in review shows one callout with **Apply change** and **Discard change**, and both lists together: added entries in green, removed ones in red. Editing is disabled until it's resolved, and discarding asks for confirmation. Only the change on screen is resolved (`pending_requested_at`). - A list the worker is still applying shows as applying and is polled, instead of showing the "not applied correctly" error. - Entries that aren't valid ranges are marked Invalid with a suggested correction, and can be saved corrected. The add dialog rejects IPv4-mapped IPv6 addresses and finds duplicates spelled differently. There's no way to create a review yet: a change only ends up in review when the backend fails to apply a list. I tested the review state locally by editing the database directly. Stacked on #53046, which syncs the API types with production, including the review endpoint. This PR will be retargeted to `master` once that merges. ## Screenshots <img width="712" height="473" alt="Screenshot 2026-11-04 at 5 10 19 PM" src="https://github.com/user-attachments/assets/c72cc38d-f7b4-4269-a787-f27dfe382086" /> ### If pressing `apply` <img width="704" height="150" alt="Screenshot 2026-11-04 at 5 19 27 PM" src="https://github.com/user-attachments/assets/92dce8e5-8d58-48b8-8899-ed01c9f242c2" /> ### If pressing `discard` <img width="712" height="473" alt="Screenshot 2026-11-04 at 5 10 38 PM" src="https://github.com/user-attachments/assets/85656004-d510-4cef-89c1-80d9f95ebb83" /> ### Invalid <img width="754" height="596" alt="Image" src="https://github.com/user-attachments/assets/4ba480f6-af4c-4253-9693-2c545fb77ab1" /> ### Invalid repair <img width="704" height="680" alt="Screenshot 2026-11-04 at 6 03 20 PM" src="https://github.com/user-attachments/assets/ed4e3dcf-8d9b-4588-afc0-938248c78712" /> ### Invalid and Pending <img width="704" height="593" alt="Image" src="https://github.com/user-attachments/assets/7ad76b50-0d08-4505-89ad-b6afff6865af" /> ### Invalid and Pending repair <img width="704" height="585" alt="Screenshot 2026-11-04 at 6 05 04 PM" src="https://github.com/user-attachments/assets/b123453f-0f30-452d-b84c-a556c52458a0" /> ## Review instructions 1. Locally, put a project's network restrictions into review by editing the database directly. There's no API that creates one. 2. Open Database Settings > Network restrictions and check the callout and the added and removed entries. 3. Apply or discard the change. ## Checklist Check all before review: - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) |
||
|
|
597d1ce56e |
fix(studio): pass caller options to grant-gated query factories (#53088)
## Context Grant-gated query factories returned `queryFn: skipToken` when the caller had no grant. TanStack Query keeps one options object per cache entry, overwritten by whichever observer rendered last. When that was a grant-less observer, invalidation refetched with `skipToken` and failed with `Missing queryFn`, breaking the query for every other observer on the key. #53075 patched two call sites; this fixes the factories. ## Changes - New `grantedQueryOptions` helper (`data/granted-query-options.ts`). Without a grant, the factory sets `queryFn: undefined` instead of `skipToken`, so TanStack borrows the query function from a subscribed observer that has one. The caller's `enabled` applies only when the factory has a query function. - `apiKeysQueryOptions`, `revealedApiKeysQueryOptions`, `branchesQueryOptions`, `branchQueryOptions` and `branchDiffQueryOptions` take caller options as a second argument. Call sites change from `useQuery({ ...f(vars), enabled })` to `useQuery(f(vars, { enabled }))`, so callers can't override the grant gate. - New type-aware `fga/no-spread-granted-query-options` lint rule (error). `grantedQueryOptions` returns a type-only brand, and the rule flags any spread or `Object.assign` of a branded value, however it was built or named. - Restores typed linting as a separate pass (`eslint.type-checks.config.cjs`, run by `pnpm lint` via `lint:type-checks`), as #44678 did. Enabling type info in the main config changes what other plugins report, so it stays separate. - `studio-queries` skill documents the pattern. Callers still pass their own grant, so the UI gates on the same grant the request carries. ## Testing - `data/api-keys/api-keys-query.test.tsx`: a granted and a grant-less component share the key, with the grant-less one rendering last; invalidation via the delete mutation refetches successfully. Fails on master with `Missing queryFn`. - `data/granted-query-options.test.ts`: `enabled` gating, factory fields win over caller fields, `select` type inference. - Lint rule cases in `scripts/__tests__/fga-eslint-rules.test.ts`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) |
||
|
|
fe7b3ad6af |
chore: bump @graphql-codegen and its deps (#52785)
## Problem `@graphql-codegen/cli` and related packages in `apps/studio` and `apps/docs` were pinned to old major versions (`cli` 5.0.5, `typescript` 4.1.6, `typescript-resolvers` 4.5.0). ## Solution - Bump `@graphql-codegen/cli` to `^7.0.0` and `@graphql-codegen/typescript-resolvers` to `^6.0.0`. Drop the explicit `@graphql-codegen/typescript` dependency from `apps/docs`. - Regenerate the Studio GraphQL output in `apps/studio/data/graphql/` with the new codegen. The generated files now include an `index.ts` export change, and `graphql.ts` is much smaller. - Refresh `apps/studio/scripts/schema.graphql`, which picks up the new `ManagementApiReference` search result type. - Update `.prettierignore` (ignore `apps/studio/.output`, `apps/studio/dist`, and all of `apps/ui-library/public`) and run Prettier on the regenerated files. ## Review instructions 1. Check the dependency bumps in `apps/studio/package.json` and `apps/docs/package.json`. 2. Re-run the Studio codegen and confirm it produces no diff in `apps/studio/data/graphql/`. 3. Run `pnpm typecheck` and confirm the GraphQL consumers in Studio still compile. ## Checklist Check all before review: - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [ ] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
b1cc9cf436 |
fix(studio): show an error toast when deleting a JWT signing key fails (#53087)
## What kind of change does this PR introduce? Bug fix ## What is the current behavior? On the JWT Keys settings page, the delete mutation for a signing key is called with a custom `onError` that only closes the dialog. A custom `onError` replaces the hook's default error toast, so when the API rejects the delete (for example a 422 for a revoked key that cannot be deleted yet), the dialog closes and nothing tells the user why. ## What is the new behavior? The custom `onError` still closes the dialog, and now also shows `Failed to delete JWT signing key: <API error message>` as an error toast. ## How to verify 1. Open Project Settings > JWT Keys on a project with a revoked signing key that the API refuses to delete. 2. Click Delete on the revoked key and confirm. 3. An error toast appears with the API's error message, and the dialog closes. 4. Deleting a revoked key that the API accepts still shows "Successfully deleted key" and removes it from the list. ## Checks run - `pnpm turbo run lint --filter='[origin/master]'` - Studio typecheck (`tsc --noEmit` in `apps/studio`; the turbo run ran out of memory, the direct run passed) - Prettier check on the changed file [FE-4943](https://linear.app/supabase/issue/FE-4943/no-error-message-shown-when-deleting-revoked-jwt-key-fails) Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> |
||
|
|
f8990cbda7 |
fix(studio): only show free Micro upgrade banner on paid plans (#53041)
## What kind of change does this PR introduce? Bug fix ## What is the current behavior? The project homepage shows the "free upgrade to Micro" banner (`BannerFreeMicroUpgrade`) for any project on Nano compute that is near resource exhaustion, regardless of the organization's plan. The free Micro upgrade only applies to paid plans, so organizations on the Free plan can see a banner offering something they are not eligible for. `ComputeBadgeWrapper` already gates the equivalent upgrade glow on `plan.id !== 'free'`. ## What is the new behavior? `ProjectLayout` only shows the banner when the selected organization's plan is known and is not `free`. The plan comes from the already-loaded selected organization, so this adds no new request. While the plan is unknown, the banner stays hidden. ## How to verify - In a project of a Free plan organization on Nano compute with a resource exhaustion warning, the project homepage does not show the free Micro upgrade banner. - In a project of a paid (Pro or higher) organization on Nano compute with a resource exhaustion warning, the project homepage still shows the banner. - Projects not on Nano compute, or without exhaustion warnings, show no banner, same as before. ## Checks run - `pnpm turbo run typecheck --filter='...[origin/master]'`: pass - `pnpm turbo run lint --filter='[origin/master]'`: pass - Prettier check on the changed file: pass - `vitest related` for the changed file could not run in the sandbox (it stopped on a parse error in an unrelated static `.md` file before reaching any test). No existing test covers this banner condition. [FE-4366](https://linear.app/supabase/issue/FE-4366/free-micro-upgrade-banner-missing-plan-tier-gate-in-projectlayout) --------- Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> |
||
|
|
e8a82b4db2 |
docs(mcp): document notebook tools for MCP v0.16.0 (#53045)
## Problem [MCP 0.16.0](https://github.com/supabase/mcp/releases/tag/mcp-server-supabase-v0.16.0) enables the notebook tools (`create_notebook`, `run_notebook`, `delete_notebook`) alongside `list_notebooks` and `get_notebook`, in the `notebooks` feature group, and [0.16.1](https://github.com/supabase/mcp/releases/tag/mcp-server-supabase-v0.16.1) enables that group by default. The MCP docs page doesn't mention them or their confirmations, and the configuration panel has no way to select the group or skip its confirmations. ## Solution Document the Notebooks group on the MCP page in the same format as the other groups: hosted only, not available in local or self-hosted Studio. Add a Notebook confirmations section covering `run_notebook` and `delete_notebook` elicitation and read-only behavior. Add `run_notebook` and `delete_notebook` to `skip_elicitations`, and add a Notebooks recommendation covering the per-run limits (50 query cells, about 1 MB of rows). In the configuration panel and Studio Connect sheet, add Notebooks as a default group for hosted connections only. A `defaultDisabled` flag on each group replaces the hardcoded Storage exclusion, and the notebook skip options appear only while Notebooks is enabled. No docs change needed for the other 0.16.0 and 0.16.1 fixes (feedback `project_id`, project ref hint, `partition_of`, check expressions, EXPLAIN confirmation, edge function paths, notebook URLs in tool outputs). ## Before merge - [supabase/platform#38799](https://github.com/supabase/platform/pull/38799) must ship. Until then, hosted only serves `list_notebooks` and `get_notebook`. - The scoped token permissions table is generated from the platform `mcp-tools-permissions` endpoint, which doesn't list `create_notebook`, `run_notebook`, or `delete_notebook` yet. ## Verification <img width="838" height="367" alt="image" src="https://github.com/user-attachments/assets/29d1bd4e-5046-4986-9dbb-ed077bdf3a56" /> MCP Docs preview [page](https://docs-git-rodriguespn-ai-1409-mcp-docs-v0-16-0-supabase.vercel.app/docs/guides/ai-tools/mcp) Closes AI-1409 |
||
|
|
06d43f6881 |
Joshenlim/fe 4721 cmd k support searching for triggers (#52755)
## Context Building off from [here](https://github.com/supabase/supabase/pull/52751) to make Cmd+K resource-aware so finding and inspecting anything in a project doesn't depend on knowing where it lives in the dashboard. Specifically looking into database entities for now - end state would be that you could search for a table name for example, and Cmd K will pull up everything related to that table for you to skim (e.g Policies, Functions, Triggers, etc). Changes in this PR sets up searching for **database triggers**, and will probably be the last database entity that we'll add into context aware cmd K for now given that we'll have tables, policies, functions and triggers which are the primary building blocks for a project. <img width="500" alt="image" src="https://github.com/user-attachments/assets/242ec517-88cd-4f3d-96ce-741edaa8560d" /> Triggers will also match if it's function matches the search input, and its description will tweak slightly as well <img width="500" alt="image" src="https://github.com/user-attachments/assets/65f515df-b875-4b92-95b7-00389d8a070b" /> ## Performance Had Claude do some benchmarking against `getSearchEntitiesSql` (`EXPLAIN ANALYZE`, median of 5 runs, local Postgres, warm cache) on one synthetic catalog: - 12,000 tables (36,651 `pg_class`), 6,001 policies, 27,261 `pg_proc` (12,000 user + 12,000 extension-owned functions), 56,304 `pg_trigger` - 3,500 user triggers, 500 of which run one shared function; the rest are internal FK triggers - 297,921 `pg_depend`. Compared against master (tables + policies) and the functions PR (before triggers). | Search | What it exercises | master | functions PR | this PR | Δ this PR | |---|---|---|---|---|---| | `t_1` | broad table match | 12ms | 26ms | 30ms | +4ms | | `p_1` | broad policy-name match | 15ms | 27ms | 35ms | +8ms | | `fn_1` | broad function match | 10ms | 26ms | 33ms | +7ms | | `trg_1` | broad trigger-name match | 9ms | 23ms | 32ms | +9ms | | `trg_` | every user trigger matches by name | 10ms | 25ms | 40ms | +15ms | | `audit_row_fn` | function match; its 500 triggers match only through the function | 9ms | 24ms | 31ms | +7ms | | `ri_constraint` | only internal FK triggers match | 9ms | 24ms | 30ms | +6ms | | `stress.fn_1` | schema-qualified | 12ms | 33ms | 40ms | +7ms | | `zzz` | no match | 9ms | 22ms | 27ms | +5ms | - Triggers add +4 to +15ms over the functions PR. The worst case is a search matching every user trigger, at 40ms in total. - Matching triggers through their function shares the single `pg_trigger` pass the name search already does, with no extra scan. A separate pass measured about 30ms more on every search. ## To test - [ ] Search a table name: Tables first, then policies, and functions, and triggers - [ ] Search a trigger name: it appears under triggers and opens the editor panel in database/triggers - [ ] Search a function name: trigger results should appear if the trigger uses that function - [ ] Trigger outside public: schema filter switches and the trigger opens |
||
|
|
7a9f019825 |
Fix api keys query cache entry (#53075)
## Context Creating a secret API key on Project Settings -> API Keys showed "Failed to load secret API keys" with `Missing queryFn: '["projects","<ref>","api-keys"]'`. <img width="1148" height="212" alt="image" src="https://github.com/user-attachments/assets/72d5daf7-b894-401c-9e8d-8d180c3d6ecd" /> This was happening as two components on the page (the API docs panel and the connection popover) fetched the same API keys data but turned fetching off by removing the fetch function. After you created a key, the refetch used their missing fetch function instead of the real one and failed. So the fix here is just to pass the real grant and gate fetching with `enabled` instead ## To test - Open `/project/[ref]/settings/api-keys`. - Click **New secret key** and create a key. - The key list refreshes with the new key and there is no "Failed to load secret API keys" error. |
||
|
|
1fcd420530 |
feat(studio): suggest enabling Explorer preview on notebook pages (#53060)
## Problem Direct notebook links open even when the Explorer feature preview is off, while the navigation item stays hidden. Users who land on a notebook this way get no hint that the Explorer preview exists or how to turn it on. Resolves FE-4939: https://linear.app/supabase/issue/FE-4939/suggest-enabling-explorer-preview-when-opening-notebook-links ## Solution - Add `ExplorerPreviewSuggestion`, an admonition titled "Explorer is a feature preview" with the text "Enable the Explorer preview to find notebooks from the navigation bar." and an "Enable Explorer" button. The button opens the feature preview modal on the Explorer entry. - Render it below the notebook toolbar in `ExplorerNotebookTab`, only in the loaded notebook state. - Show it only on platform, when the `explorer` flag is on and the user has not opted in to the preview. It is not dismissible and disappears once the preview is enabled. ## Testing - Existing Explorer component tests pass. - Lint ratchet passes. - Manual check: with the `explorer` flag on and the preview off, open a notebook URL directly, confirm the notice appears, and confirm the button opens the feature preview modal. ## Review instructions 1. Enable the `explorer` flag and make sure the Explorer feature preview is off. 2. Open a notebook URL directly. 3. Confirm the "Explorer is a feature preview" notice appears below the notebook toolbar. 4. Click "Enable Explorer" and confirm the feature preview modal opens on the Explorer entry. 5. Enable the preview and confirm the notice disappears. ## Checklist Check all before review: - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [ ] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) --------- Co-authored-by: Joshen Lim <joshenlimek@gmail.com> |
||
|
|
757040ffc7 |
feat(studio): add reveal refinement for single api-key reads (#52965)
Part 5 of 6 in a stack for [FE-4731](https://linear.app/supabase/issue/FE-4731/grants-rollout-api-keys-consumers-that-only-need-publishable-keys). Based on #52964. ## Stack 1. #52961 Docs and project API docs consumers 2. #52962 Edge functions and vector bucket examples 3. #52963 Integrations landing data 4. #52964 Connect sheet and project connection popover; remove the transitional api-keys hooks 5. 👉 #52965 `reveal` refinement for single api-key reads; API key pill 6. #52966 API key create and delete ## Changes - Adds a `reveal` refinement for `GET /v1/projects/{ref}/api-keys/{id}`, mirroring the list endpoint: the `reveal` variant adds `api_gateway_keys_secret_read`, and the wrapper owns the `reveal` query param. - `getAPIKeysById` takes a plain or reveal grant instead of `unguarded.migrating` and a manual `reveal` flag. - `useRevealedSecret` mints the reveal grant, returns it, and doesn't request unless it's granted. - `ApiKeyPill` uses the reveal grant instead of its V2 check. Reveal and copy are disabled while the check loads, when denied, or when it fails. Publishable keys aren't gated. - `useConnectServerEnv`: the secret can only be revealed once the reveal grant is granted. **Guard drift:** `ApiKeyPill` checked only `api_gateway_keys_secret_read`, but the endpoint needs `api_gateway_keys_read` and `api_gateway_keys_secret_read`. Users with only the secret permission saw an enabled button and got a 403; they now see it as restricted. ## Testing - `data/guarded-fetch.test.ts`: type tests for the by-id endpoint (plain and reveal grants match the raw client, `reveal` rejected as a caller param, a list-endpoint reveal grant rejected), and a runtime test that `reveal` is set from the grant. The "variant the endpoint doesn't have" negative now uses the branches endpoint. - `ApiKeyPill.platform.test.tsx` (renamed from `ApiKeyPill.test.tsx`, now on real grants through MSW): reveal and copy when granted, denied (no request), permission-check error, publishable keys not gated. 🤖 Generated with [Claude Code](https://claude.com/claude-code) |
||
|
|
e05ef0e50c |
fix(studio): use API collation warning for read replica eligibility (#53049)
## What
Read replica eligibility now uses the `collation_reindex_required`
warning returned by the upgrade eligibility endpoint
(`/v1/projects/{ref}/upgrade/eligibility`) to decide whether to block
replica creation, instead of reimplementing the collation lineage
boundary check in Studio.
- Removes `CollationLineage.utils.ts` and its tests.
- `useCheckEligibilityDeployReplica` sets `isCollationLineageCrossed`
when the response includes a `collation_reindex_required` warning.
## API types
Regenerated `packages/api-types` from the production specs so the new
warning type is available. The regen also picks up other recent API
changes, which Studio now handles so typecheck passes:
- `PROMOTING` project status: added labels in `BranchStatusBadge` and
the dev toolbar's `ProjectStatusTab`.
- `table_using_reg_type` upgrade validation error (tables with columns
using `reg*` types that `pg_upgrade` can't carry over): added a title,
description, and Manage link to the table in `UpgradeWarnings`.
## Testing
- Studio typecheck passes (the one remaining error, in `ui-patterns`
McpUrlBuilder, is also on `master`).
- Read replica and infrastructure settings unit tests pass.
|
||
|
|
1d0398db4b |
feat(studio): gate connect sheet and project connection popover on api-keys grants (#52964)
Part 4 of 6 in a stack for [FE-4731](https://linear.app/supabase/issue/FE-4731/grants-rollout-api-keys-consumers-that-only-need-publishable-keys). Based on #52963. ## Stack 1. #52961 Docs and project API docs consumers 2. #52962 Edge functions and vector bucket examples 3. #52963 Integrations landing data 4. 👉 #52964 Connect sheet and project connection popover; remove the transitional api-keys hooks 5. #52965 `reveal` refinement for single api-key reads; API key pill 6. #52966 API key create and delete ## Changes Moves the last publishable-key consumers onto the plain `GET /v1/projects/{ref}/api-keys` grant: - `ConnectSheet`: shows `ApiKeysAccessNote` under the mode selector (except the warehouse and server modes; the server panel has its own note) - `useConnectServerEnv`: `canReadAPIKeys` and its loading state come from the grant, and the hook returns the grant. The on-demand secret reveal is unchanged here (part 5 moves it). - Server env content: shows the note next to the disabled copy buttons - `ProjectConnectionPopover`: only fetches while open. The nested ternary for the key display is replaced with a flat helper covering loading, denied, error, and the key. With no callers left, the deprecated transitional `useAPIKeys` / `useAPIKeysQuery` hooks are removed from `data/api-keys/api-keys-query.ts`. The old guards matched the annotation. ## Testing - `ProjectConnectionPopover.platform.test.tsx` and `content/server/env/content.platform.test.tsx`: granted, denied (no request), and permission-check error. - `useConnectServerEnv.test.ts` updated for the grant. 🤖 Generated with [Claude Code](https://claude.com/claude-code) |
||
|
|
c5cdb59c47 |
feat(studio): prerender signed-out auth pages in the TanStack build (#52690)
## Problem
The TanStack Start build serves every document from the prerendered SPA
shell (`_shell.html`). For signed-out pages such as `/sign-in` and
`/sign-up`, the first HTML response holds only the loading fallback and
the generic `<title>Supabase</title>`. The page content and route
`head()` tags only appear after the JS bundle hydrates.
## Solution
On platform builds, prerender `/sign-in`, `/sign-up`, `/sign-in-sso` and
`/forgot-password` to static HTML next to the shell.
- `lib/prerendered-routes.ts`: the list of prerendered paths, shared by
the build config, the Vercel routes and the root route.
- `vite.config.ts`: passes the paths to `tanstackStart({ pages })` with
link crawling off, so only these pages are prerendered. Self-hosted
builds prerender nothing (self-hosted sign-in redirects straight to the
default project).
- `scripts/vercel-spa-routes.ts`: serves `<path>/index.html` for each
prerendered path (with and without the base path, optional trailing
slash, case-sensitive), ahead of the shell catch-all.
- `routes/__root.tsx`: renders `<Outlet />` once hydrated, or before
hydration when the path is prerendered; otherwise `<ShellFallback />`.
The Outlet stays at the same position in the tree, so navigating away
from a prerendered page doesn't remount it.
One prerendered file serves every visitor and every query string, so the
first render of these pages can't depend on per-visitor state:
- Search-param reads that affect render return empty until
`useHydrated()`, then update. `useInboundBranding` checks this directly,
and the "Sign up", "Sign in" and "Continue with SSO" link hrefs read
from `useHydratedQuery`.
- The "Sign in" links on `/sign-up` and `/forgot-password` now carry the
query params. The `/sign-up` link drops `returnTo=/new`, the default the
"Sign up" link sets, so existing users don't land in the new-org flow.
- Form controls sit in a `DisabledUntilHydrated` fieldset, so input
typed before hydration isn't lost and Enter can't natively POST the
form.
- The sign-in/forgot-password logo switches light/dark via CSS (`dark:`
classes) instead of `resolvedTheme` after mount, so dark-theme users
don't see the light logo first.
- `SignInLayout`'s session redirect effect skips the redirect after
unmount.
Also adds page titles for `/sign-in-sso` and `/forgot-password`.
## Review instructions
1. View source (not the inspector) of `/dashboard/sign-in`,
`/dashboard/sign-up`, `/dashboard/sign-in-sso` and
`/dashboard/forgot-password` on the preview: the HTML holds the form and
the page title, not the loading fallback. `/dashboard/organizations`
still returns the shell.
2. Load `/dashboard/sign-in?returnTo=%2Fproject%2F<ref>`: no hydration
errors in the console, and the "Sign up" link (hover / open in new tab)
carries the same `returnTo`. The "Sign in" links on `/dashboard/sign-up`
and `/dashboard/forgot-password` carry the query params too.
3. Sign in from that URL: you land on the project, with no second
redirect to `/organizations`.
4. Load `/dashboard/sign-in?destination=cli`: the CLI-branded heading
renders without a hydration error.
5. Links between the four pages navigate client-side, and dark mode
shows the dark logo straight away.
## Checks
- Platform `vite build` (`NEXT_PUBLIC_IS_PLATFORM=true
NEXT_PUBLIC_BASE_PATH=/dashboard`): prerenders the four pages plus the
shell; each file has its title, inputs and a disabled fieldset.
Self-hosted build prerenders only the shell.
- Served the build locally with Vercel-equivalent routing and checked in
a browser: no hydration errors for plain, `?returnTo=…`,
`?destination=cli` (with and without `method`),
`/sign-up?destination=cli` and `/Sign-In`; hrefs carry `returnTo` after
hydration; navigating from `/sign-in` to other routes doesn't remount
the sign-in form or flash the shell loader; with JS blocked, inputs and
submit are disabled.
- Unit tests for `isPrerenderedRoute` and the prerendered Vercel routes;
`tsc --noEmit`, ESLint on changed files, Prettier, knip and the lint
ratchet pass.
- Not covered locally: the signed-in `returnTo` redirect end to end
(review step 3).
## Checklist
- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [ ] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs
[style
guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)
---------
Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com>
Co-authored-by: Kody Jackson <kody.jackson@supabase.io>
Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
|
||
|
|
1fb63b7d85 |
fix(ui): lift tooltip from the page and use a ring edge (#52631)
## Problem - tooltips blend into the page in dark mode, for example the timestamp tooltip in the logs table - the tooltip background is `bg-alternative`, which is the same color as the page background ## Solution - changes the tooltip background in dark mode, so the tooltip is one elevation step above the page - replaces the border and the drop shadow with a 1px ring from the `foreground` token, so the edge is thinner and uses theme tokens - changes the row highlight in the timestamp tooltip - fixes the "Copied!" state in the timestamp tooltip, so the copied value does not show behind the text and the row keeps its width | before | after | | -------|------| | <img width="357" height="162" alt="image" src="https://github.com/user-attachments/assets/07435a9e-74eb-4007-aa5e-d350a979f8bb" /> | <img width="357" height="162" alt="image" src="https://github.com/user-attachments/assets/df274062-318e-4ed0-841a-2bf57c98ec4c" /> | | <img width="357" height="162" alt="image" src="https://github.com/user-attachments/assets/1cfc18fa-196e-41e2-9aae-2458cd98418b" /> | <img width="357" height="162" alt="image" src="https://github.com/user-attachments/assets/c116329c-233c-4216-9a71-4a1950ec710a" /> | <!-- ## Preview links If relevant, include links to changed pages for easy review access. Copy the preview base URL from the Vercel bot comment on this PR. Use the following table as an example template. | Site | Live | Preview | Search for | | -------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | ----------------------------- | | WWW | [/blog/your-post](https://supabase.com/blog/your-post) | [/blog/your-post](https://zone-www-dot-com-git-branch-name-supabase.vercel.app/blog/your-post) | unique phrase from the change | | Docs | [/docs/guides/your-page](https://supabase.com/docs/guides/your-page) | [/docs/guides/your-page](https://docs-git-branch-name-supabase.vercel.app/docs/guides/your-page) | unique phrase from the change | | Studio | [/dashboard](https://supabase.com/dashboard) | [/dashboard](https://studio-git-branch-name-supabase.vercel.app/dashboard) | unique phrase from the change | | Design system | [/design-system](https://supabase.com/design-system) | [/design-system](https://design-system-git-branch-name-supabase.vercel.app/design-system) | unique phrase from the change | | UI library | [/library](https://supabase.com/library) | [/library](https://ui-library-git-branch-name-supabase.vercel.app/library) | unique phrase from the change | | Knowledge base | [/kb/guides/your-page](https://supabase.com/kb/guides/your-page) | [/kb/guides/your-page](https://kb-git-branch-name-supabase.vercel.app/kb/guides/your-page) | unique phrase from the change | --> <!-- ## Additional context Optionally add any other context or screenshots. --> ## Review instructions 1. open [/design-system/docs/components/tooltip](https://design-system-git-antlio-tooltip-contrast-supabase.vercel.app/design-system/docs/components/tooltip) and set the theme to dark 2. hover the "Hover" button, and make sure that the tooltip is lighter than the page and has a thin ring edge 3. set the theme to light, and make sure that the tooltip has a thin ring edge and no drop shadow 4. open [/dashboard/project/_/logs/edge-logs](https://studio-git-antlio-tooltip-contrast-supabase.vercel.app/dashboard/project/_/logs/edge-logs) in dark mode and select a project 5. hover a date in the logs table, and make sure that the tooltip is lighter than the table 6. hover each row in the tooltip, and make sure that the row highlight shows 7. click a row, and make sure that "Copied!" shows with no value text behind it and the tooltip width does not change ## Checklist Check all before review: - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [ ] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) |
||
|
|
6d08d66b7d |
Add eslint rule for google translate dynamic spans + address all issues (#52949)
## Context We've been seeing many `NotFoundError: Failed to execute 'removeChild' on 'Node'` and `NotFoundError: Failed to execute 'insertBefore' on 'Node'` events on Sentry which are historically known to be caused by Google Translate in the browser. There's technically no _right way_ to address this unfortunately, but one of the solutions which should address most of these issues is to wrap any dynamic text within a span - we've considered that quite a while back tbh but never took the time to do this until today with the help of Claude. Although just a heads up that it might not necessarily completely eradicate those issues. Also added an eslint rule which should prevent future occurences of this <img width="1264" height="192" alt="image" src="https://github.com/user-attachments/assets/b2c32ea0-45a2-4ccd-82fe-1a859905fc29" /> |
||
|
|
40bb24353d |
fix(studio): keep service health windows within DST limits FE-4928 (#53027)
## Problem The home dashboard's 7-day charts can fail after daylight saving time ends. Subtracting seven local calendar days produces a 169-hour request, exceeding the service-health endpoint's 168-hour limit. The same calculation also changes the 24-hour window across DST transitions. ## Fix Calculate the shared service-health windows using 24 and 168 elapsed hours. Add regression coverage for both daylight saving transitions in America/New_York. Fixes [FE-4928](https://linear.app/supabase/issue/FE-4928/re-dashboard-is-not-showing-correct-data). ## How to test - Run `pnpm --dir apps/studio exec vitest run --retry=0 components/interfaces/Observability/useServiceHealthMetrics.utils.test.ts`. - In a browser using America/New_York around the November 1 DST transition, open a project's home dashboard and select the 7-day view. - Expected result: the service-health request spans exactly 168 hours and the charts load. The 24-hour view spans exactly 24 hours across either DST transition. Local verification: Studio typecheck, focused ESLint, Prettier, and 41 affected tests pass. All four DST regressions fail against the original helper and pass with the fix; shuffled tests also pass with seed 4928 and TZ=UTC. |