mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 23:49:03 +00:00
create-pull-request/patch
40517
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
31711c0762 |
fix(studio): validate edge function test proxy target url (#53256)
The edge function test proxy (`pages/api/edge-functions/test.ts`, also
served by `routes/api/edge-functions/test.ts`) fetched the URL from the
request body after checking it only with the regexes in
`isValidEdgeFunctionURL`, and on self-hosted any
`http(s)://<host>/functions/vN/...` URL passed. It now fetches only a
URL rebuilt from parts it has validated.
**Changed:**
- `apps/studio/lib/api/edgeFunctions.ts` – replaced
`isValidEdgeFunctionURL` with `getEdgeFunctionTestUrl`, which parses the
URL, rejects non-http(s) schemes and credentials, requires a
`/functions/vN/` path, checks the host (platform:
`<ref>.supabase.co|red` over https; the Nimbus apex domain when
`NIMBUS_PROD_PROJECTS_URL` is set; self-hosted: the `SUPABASE_URL` or
`SUPABASE_PUBLIC_URL` host) and returns the fetch target rebuilt from
the validated origin, path and query. Self-hosted requests always go to
the `SUPABASE_URL` origin, replacing the old `SUPABASE_PUBLIC_URL`
string rewrite.
- `apps/studio/pages/api/edge-functions/test.ts` – fetches the URL
returned by `getEdgeFunctionTestUrl` and returns 400 when there is none.
`redirect: 'manual'` is unchanged.
**Added:**
- `apps/studio/lib/api/edgeFunctions.test.ts` – allowed platform,
`.red`, Nimbus and self-hosted URLs, and rejected cases: other hosts,
lookalike hosts, userinfo, ports, non-http schemes, paths outside
`/functions/vN/`.
- `apps/studio/tests/pages/api/edge-functions/test.test.ts` – handler
rejects userinfo and non-functions paths, and on self-hosted calls the
public URL through `SUPABASE_URL` and rejects other hosts.
## To test
- [ ] On platform (including staging `.red`), open an edge function,
click **Test**, and send a request with a query parameter: the response
shows as before.
- [ ] On self-hosted (`docker compose`), do the same from the edge
function tester: the response shows as before.
- [ ] `POST /api/edge-functions/test` with `{ "url":
"https://example.com/functions/v1/hello", "method": "GET" }`: the
response is 400 with "Provided URL is not a valid Supabase edge function
URL".
---------
Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
|
||
|
|
3b57afc40c |
fix(studio): wait for project endpoint before showing function url (#53255)
`EdgeFunctionsListItem` built its URL as ``
`${endpoint}/functions/v1/${slug}` `` from `useProjectApiUrl`, whose
`data` is `undefined` while the project settings query is still pending.
On a cold load, each row showed `undefined/functions/v1/<slug>`, and the
copy button copied that string. `EdgeFunctionDetails` and
`TerminalInstructions` interpolated the endpoint the same way.
**Changed:**
-
`apps/studio/components/interfaces/Functions/EdgeFunctionsListItem.tsx`:
only builds the URL once `endpoint` is defined. While it's pending, the
row shows a `ShimmeringLoader` in place of the URL and no copy button.
The copy button now has an accessible name ("Copy function URL").
-
`apps/studio/components/interfaces/Functions/EdgeFunctionDetails/EdgeFunctionDetails.tsx`:
the "Invoke function" snippets wait for both the endpoint and the
function. Until then they show a skeleton, so the cURL tab no longer
renders or copies `undefined/functions/v1/...`. If either query fails,
the card shows an `AlertError` instead.
-
`apps/studio/components/interfaces/Functions/TerminalInstructions.tsx`:
the "Invoke your function" curl command is only added once the endpoint
resolves, with a loader in its place until then.
Also checked: `EdgeFunctionOverviewHeader` already guards on `endpoint
&& slug`, so it's unchanged. `EdgeFunctionTesterSheet` doesn't use
`useProjectApiUrl`: it builds the URL from project settings at submit
time and never renders it, so it's also unchanged. `useProjectApiUrl`
itself is unchanged.
**Added:**
-
`apps/studio/components/interfaces/Functions/EdgeFunctionsListItem.test.tsx`:
renders a row while the settings request is in flight and asserts
there's no `undefined/functions/v1` text, a loader is shown and there's
no copy button. Once settings resolve, it asserts the full URL and that
the copy button copies it. It fails on the old component.
-
`apps/studio/components/interfaces/Functions/EdgeFunctionDetails/EdgeFunctionDetails.platform.test.tsx`:
a case where project settings fail to load, asserting the invoke card
shows the error and no cURL snippet.
## To test
- [ ] Open a project's Edge Functions page (`/project/<ref>/functions`)
with a hard reload and network throttling (for example "Slow 4G"). The
URL column never shows `undefined`: it shows a loader, then
`https://<ref>.supabase.co/functions/v1/<slug>`.
- [ ] Click a row's copy icon: the clipboard has the full function URL
and the page doesn't navigate.
- [ ] Click a row: it still navigates to that function's page.
- [ ] Hard reload a function's Details page
(`/project/<ref>/functions/<slug>/details`) with throttling. The cURL
snippet under "Invoke function" shows a skeleton, then the real URL.
- [ ] Open `/project/<ref>/functions?create=cli` with throttling. The
"Invoke your function" curl command shows a loader, then the real URL.
---------
Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
|
||
|
|
5eb68c5df2 |
Add indexes to cmd k related resources in table editor (#53204)
## Context We previously added a "Related resources" section in Cmd+K if you're on the Table Editor with a table opened, this included resources pertaining to the table such as policies, triggers, and functions. We're adding indexes as well in this PR - thinking that might also be appropriate to have in this context <img width="500" alt="image" src="https://github.com/user-attachments/assets/5cd383ff-6617-49ba-bdb8-6f65d8fd0680" /> ## Performance Benchmarked with Claude against the stress catalog (`PG_META_STRESS_TABLES=12000`), with master and this branch timed in the same run on the same database, median of 9. | Table | master | This PR | Worst of 9 | |---|---|---|---| | Hub table — 8 indexes, policy, many FK triggers | 1.6 ms | 2.3 ms | 2.8 ms | | Policy + user trigger | 1.0 ms | 1.3 ms | 2.0 ms | | Mid-chain table | 1.1 ms | 1.5 ms | 1.7 ms | | Deliberately over-indexed table — 20 indexes | 0.8 ms | 2.0 ms | 4.6 ms | | Table that doesn't exist | 1.1 ms | 1.5 ms | 4.5 ms | |
||
|
|
5e7e9d2cf5 |
fix(studio): parse stripe sync bearer token without backtracking regex (#53254)
`getBearerToken` in the Stripe Sync API handler parsed the
`Authorization` header with `/^Bearer\s+(.+)$/i`. Both `\s+` and `(.+)`
can match whitespace, so a header made of `Bearer` and a long run of
whitespace backtracks in quadratic time (CodeQL `js/polynomial-redos`).
The token is now parsed with `slice`, a case-insensitive scheme check
and `trim`.
**Changed:**
- `apps/studio/lib/api/apiHelpers.ts` – new shared
`getBearerToken(authorization)` that parses in linear time. It returns
`null` for a missing, array-valued, non-Bearer or empty/whitespace-only
header. Previously a whitespace-only token returned `''` instead of
`null`, which still got a 401.
- `apps/studio/pages/api/integrations/stripe-sync.ts` – drops the local
regex helper and uses the shared one.
`apps/studio/routes/api/integrations/stripe-sync.ts` re-exports this
handler on `master`, so both routes get the fix.
**Added:**
- `apps/studio/lib/api/apiHelpers.test.ts` – `getBearerToken` cases: a
valid token, lowercase `bearer`, extra whitespace,
missing/array/wrong-scheme/empty headers, and a 100k-whitespace header
that has to return in under 100 ms (the old regex takes about 4 s).
No other API handlers in `apps/studio` or `packages/` use this regex.
The remaining `Authorization` parsing in `lib/api/apiAuthenticate.ts`
and `lib/gotrue.ts` uses `replace(/bearer /i, '')`, which runs in linear
time.
## To test
- [ ] On a project, install the Stripe Sync integration from Studio
(Integrations → Stripe Sync). Installation starts and finishes.
- [ ] Uninstall it again. Uninstallation starts and finishes.
- [ ] `curl -i -X POST <studio-url>/api/integrations/stripe-sync -H
'Authorization: Basic abc' -H 'Content-Type: application/json' -d '{}'`
returns 401. Do the same with `Authorization: Bearer` followed only by
spaces, and with no `Authorization` header: both return 401.
Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
|
||
|
|
200cc3f65d |
[FE-3106] (part 1) – ci(studio): build and test tanstack start only (#53199)
First part of the FE-3106 cleanup (final pass of the TanStack Start migration): Studio now builds, runs and tests TanStack Start only. Retiring the Next build first is what lets the follow-up PRs in this stack delete `pages/**` files without breaking a still-built Next runtime, the Next E2E shard or Next previews. Part 1 of the stack, based on `master`. **Changed:** - `apps/studio/package.json` – `dev`/`build`/`start` run the Vite/Nitro build directly (the former `*:tanstack` scripts) - `apps/studio/vercel.ts` – always emits the TanStack Start config (`framework: null`, redirects, headers); no `STUDIO_FRAMEWORK` gate, so every Vercel project building Studio deploys the Nitro output - `apps/studio/Dockerfile` – single TanStack `build` stage; the image no longer defaults to Next - `.github/workflows/studio-e2e-test.yml` – one E2E run (2 shards) instead of a `next`/`tanstack` matrix; drops the `.next` cache step - `.github/workflows/studio-docker-build.yml` – one image build - `apps/studio/turbo.jsonc` – drops `STUDIO_FRAMEWORK` and the `.next` outputs - `apps/studio/AGENTS.md`, `apps/studio/TANSTACK_MIGRATION.md` – describe the TanStack-only runtime **Removed:** - `dev:next`/`build:next`/`start:next` scripts, `scripts/dispatch.js`, `scripts/lib/env.js`, the Turbopack cache `predev` script, and the root `build:studio:docker:tanstack` script Addresses [FE-3106](https://linear.app/supabase/issue/FE-3106/move-page-bodies-into-route-files-and-delete-pages). Before merging: branch protection lists `E2E tests (next, 1, 2)`/`(next, 2, 2)` and `E2E tests (tanstack, 1, 2)`/`(tanstack, 2, 2)` as required checks. The jobs are now `E2E tests (1, 2)`/`(2, 2)`, so the required checks need updating. Any Vercel project or self-hosted image still on Next switches to TanStack Start with this PR. ## To test - `pnpm dev:studio` without `STUDIO_FRAMEWORK` set – Vite dev server starts on :8082 - `pnpm build --filter=studio` – Vite/Nitro build succeeds, no `.next` output - Vercel previews (`studio`, `studio-self-hosted`, `studio-staging`) – build and serve the TanStack app - `Studio Docker Build` and E2E checks – pass with the single TanStack run Ran `vercel.test.ts`, studio typecheck, knip, ESLint on changed files, Prettier and the TanStack build locally. Docker and E2E are verified by CI only. --------- Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com> |
||
|
|
6eb785a8a2 |
feat(studio): offer a backup authenticator after saving recovery codes (#52353)
## Problem Initial MFA setup ends without offering a second authenticator as a backup. ## Solution After initial MFA setup and saving codes, offer another authenticator without interrupting existing completion callbacks. | After | | --- | | <img width="1024" height="759" alt="56157" src="https://github.com/user-attachments/assets/81809970-2a50-425f-b4bb-792790ed8047" /> | | _The dialog that appears on step 2 below if first MFA method._ | ## Review instructions 1. Open [Security](https://studio-staging-git-dnywh-recovery-backup-offer-supabase.vercel.app/dashboard/account/security) with a disposable account without MFA. Set up MFA and save the recovery codes. 2. Choose “Add another method” to start backup setup, or “Not now” to finish. Adding a backup must not generate recovery codes again. --------- Co-authored-by: Joshen Lim <joshenlimek@gmail.com> |
||
|
|
16ea380714 |
fix(studio): reuse the account deletion confirmation pattern (#52350)
## Problem The account deletion dialog repeats the organisation requirement and leaves the form area blank while the membership check loads or fails. Its confirmation form also differs from the other deletion dialogs in Studio. ## Solution ```text Request deletion ├─ Checking memberships → loading state ├─ Membership check fails → retry ├─ Organisation memberships found → leave all organisations first └─ No memberships → shared email confirmation ``` Use `TextConfirmModal` for email validation and the shared copy control. | Before | After | | --- | --- | | <img width="1098" height="576" alt="Image" src="https://github.com/user-attachments/assets/01371989-b913-4b31-ac28-5da29447cf77" /> | <img width="838" height="436" alt="Image" src="https://github.com/user-attachments/assets/b3a2dc4d-eba0-4d2e-a698-f3c9fa14312f" /> | | <img width="876" height="674" alt="Image" src="https://github.com/user-attachments/assets/002c5e0e-b081-40ff-aeba-1bb7a24d18d1" /> | <img width="854" height="630" alt="Image" src="https://github.com/user-attachments/assets/806a9e17-753f-4d8d-8100-ce037b84a8ff" /> | ## Review instructions 1. In Preferences, select **Request deletion**. With organisation memberships, confirm the dialog says **Leave all organizations first**. Without memberships, check that the dialog shows your email and the placeholder **Type your email address in here**. When the copy control is enabled, select the email and check that it copies the address. Submit a different email to check the inline validation. [Open Preferences](https://studio-staging-git-dnywh-fix-account-deletion-copy-supabase.vercel.app/dashboard/account/me) 2. With the copy control enabled, verify that copying the email leaves the form open and keeps the input unchanged. |
||
|
|
36e8bda235 |
fix(studio): align deletion panels (#53190)
## Problem Account, project and organisation deletion settings use different warning layouts and action placement. In the organisation panel, the button sits inside the admonition description, so it stays below the copy at wide widths. ## Solution ```text Delete account / project / organisation └─ Danger admonition ├─ Consequence and supporting copy └─ Action below the copy at narrow widths, beside it at wide widths ``` Standardise the affected settings section descriptions and preserve the Vercel Marketplace action for partner-managed organisations. The account confirmation flow is reviewed separately in #52350. Both PRs target `master`. | Before | After | | --- | --- | | <img width="1458" height="484" alt="CleanShot 2026-11-10 at 14 15 06@2x" src="https://github.com/user-attachments/assets/2e7e627d-5079-464c-b7ef-51b93ca62e9a" /> | <img width="1450" height="410" alt="CleanShot 2026-11-10 at 14 13 15@2x" src="https://github.com/user-attachments/assets/88cdcd4a-463c-47be-9c95-3eab172bed29" /> | | <img width="1462" height="430" alt="CleanShot 2026-11-10 at 14 14 51@2x" src="https://github.com/user-attachments/assets/84109e7e-2e42-4252-9f1b-9760ded1f2e7" /> | <img width="1452" height="392" alt="CleanShot 2026-11-10 at 14 13 37@2x" src="https://github.com/user-attachments/assets/d2238d64-5a32-456f-addc-6fd3ce1de1fe" /> | | <img width="1868" height="394" alt="CleanShot 2026-11-10 at 14 15 22@2x" src="https://github.com/user-attachments/assets/a2ab7a9d-2d79-46fc-b600-ace07e098e55" /> | <img width="1872" height="412" alt="CleanShot 2026-11-10 at 13 26 40@2x" src="https://github.com/user-attachments/assets/fad70041-d0ea-4da6-b429-2b2fc39d2103" /> | ## Review instructions 1. Open the deletion sections in **Account preferences**, a project's **Settings → General** and an organisation's **General settings**. 2. At narrow and wide widths, check that the buttons sit below and beside the copy respectively. 3. For a Vercel-managed organisation, check that the panel still directs users to Vercel Marketplace. 4. In project and branch general settings, check the updated punctuation in the affected section descriptions. |
||
|
|
767cc52c13 |
feat(studio): track recovery code copy and download (#53195)
## Problem Studio tracks completion of recovery setup, but there are no events for copying or downloading the codes. ## Solution Track both actions in the shared recovery-code dialog. Record a copy after the clipboard write succeeds and a download when the browser starts it. The events carry no recovery-code values. ## Review instructions 1. Open [Recovery codes](https://supabase.com/dashboard/account/security#recovery-codes) on this branch's Studio preview with a disposable MFA account. Select **Generate recovery codes** or **Regenerate** if it already has a set. 2. In **Save your recovery codes**, select **Copy**, then **Download**. Check the browser network panel for `recovery_codes_copied` and `recovery_codes_download_clicked` in the telemetry requests (`telemetry/event`). |
||
|
|
8e240acbcd |
docs: add Neil Brookes to humans.txt (#53232)
## Problem Add Neil Brookes to the Supabase team list in `apps/docs/public/humans.txt`. ## Solution Insert the name into the team list in `apps/docs/public/humans.txt`. ## Review instructions 1. Open `apps/docs/public/humans.txt`. 2. Confirm `Neil Brookes` appears once, in alphabetical order. ## Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md). - [x] This change does not add or edit a docs topic. ## Self-review - Verified the one-line diff. - No build or tests were run for this static text entry. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
c68595e3b7 |
fix(studio): show MFA after a successful sign-in retry (#53196)
## Problem After a callback error, a successful password retry can show the second-factor toast and then bounce back to sign-in. The MFA page acts on the cached callback error before checking for the new session. This follows up on #46414. ## Solution Check for a current session before handling the initialisation error. ```text Current session → check whether MFA is required Callback error with no session → show the error on sign-in ``` ## Review instructions 1. In a signed-out browser, open the Studio preview at `/dashboard/sign-in?error=server_error&error_description=Test&returnTo=%2Forg`. Sign in with a password account that has MFA enabled. The code entry form should open. 2. In a separate signed-out session, open `/dashboard/sign-in-mfa?method=github#error=server_error&error_description=Test`. Studio should return to sign-in and show the callback error. The local reproduction passed with the fix, along with 22 existing sign-in tests. ## Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) --------- Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com> |
||
|
|
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. |
||
|
|
a73c5086fd |
feat(kb): send search opened and closed events (#53188)
## Problem kb search sends no event when the dialog opens or closes, so search usage has no denominator. Docs sends `docs_search_v2_opened` and `docs_search_v2_closed`. Resolves GROWTH-1474. ## Solution - adds `kb_search_opened` (`triggerType`: `keyboard_shortcut`, `search_input`) and `kb_search_closed` (`closeReason`: `dismissed`, `result_navigated`), the docs values kb can produce - `KbSearch` fires each event only on a real open or close, so Cmd+K toggling or a second open can't double-send - Enter on a result now closes the dialog before navigating, like a click does - `kb_search_closed` sends with `keepalive`, since a result click leaves the page ## Review instructions 1. `pnpm --filter kb test` 2. `NEXT_PUBLIC_IS_PLATFORM=true pnpm --filter kb dev`, accept cookies, filter network by `telemetry/event` 3. open search with the header button, press Escape, then Cmd+K twice: one opened and one closed per cycle Tested: kb and `common` tests pass, `common` typecheck passes. On `astro dev` with consent set, each open and close sent one event. Result-click close is unit-tested only (no local search API). ## 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) |
||
|
|
1353178ac9 |
feat(studio): add read/write grant variants for pg-meta query (#53185)
Resolves FE-4729. First PR of the SQL grants series (FE-4697).
## What
Adds the mechanism for read and write grants on `POST
/platform/pg-meta/{ref}/query`. Every caller keeps `unguarded.migrating`
until its domain PR.
- `fga-refinements.ts`: `read` (`database_read`) and `write`
(`database_write`) variants, with `variantRequired`.
- `@supabase/pg-meta`: a `WriteSqlFragment` brand and `asWriteSql()`.
`safeSql` and `joinSqlFragments` return `WriteSqlFragment` when any
input is one, so composing write SQL keeps the brand.
- `executeSql`: overloads tie the grant to the SQL type. Write SQL needs
a write grant; other SQL takes a read or write grant.
## Notes
- The write check is type-only. Nothing in a pg-meta query request marks
it as a write, so the development-only `assertGrant` can't detect one.
The branch variants make the same trade-off, and the backend enforces
permissions either way.
- SQL written from scratch still needs `asWriteSql` where it's built.
Domain PRs mark their builders.
- Server-side callers (AI tools) will use `unguarded.byDesign`: they
forward the user's token, so the platform API enforces permissions.
FE-4750 applies this.
## Testing
- Type tests: grant/raw-client equality for both variants, rejection of
plain and unknown-variant grants, read/write brand invariance,
`executeSql` and `mutate()` rejecting write SQL with a read grant, and
brand propagation through `safeSql` and `joinSqlFragments`.
- `unguarded.migrating` count unchanged.
|
||
|
|
8b09eff6c6 |
chore(www): add Expo and Supabase EAS CLI integration blog post (#53193)
## I have read the [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) file. YES ## What kind of change does this PR introduce? Docs update (new blog post) ## What is the current behavior? There is no blog post announcing the Supabase integration in the EAS CLI. ## What is the new behavior? Adds "Set up Supabase for every Expo environment in one command" at `/blog/set-up-supabase-for-every-expo-environment-in-one-command`, dated 2026-11-10. |
||
|
|
2ac3b77594 |
chore: replace pnpm hooks and chains with turbo task dependencies in the remaining apps (#53169)
## Problem `ui-library`, `design-system`, `learn`, `kb`, `www` and `studio` still order their build, dev and typecheck steps with pnpm `pre`/`post` hooks, `&&` chains and `run-p`. Turbo can't see those steps, so it can't cache or parallelize them. Follow-up to #52556, which migrated `apps/docs`. Part of [FE-4977](https://linear.app/supabase/issue/FE-4977/migrate-remaining-apps-pnpm-scripts-to-turbo-tasks). ## Solution The ordering now lives in each app's `turbo.jsonc` as `dependsOn`, the hooks and chains are gone, and scripts with same-package prerequisites are wrapped with `maybe-turbo`. `node .agents/skills/turbo-scripts/scripts/audit.mjs apps/<name>` reports no findings for any of the six apps. - **`ui-library`, `design-system`, `learn`:** content, registry and markdown steps are turbo tasks with declared outputs. `dev:content` uses the `with` key. `build:next` and `dev:next` are folded into `build` and `dev`. `ui-library`'s markdown task now depends on `build:registry`, which the old chain hid. `pnpm --filter library build:registry` still regenerates the committed registry output. - **`kb`:** `fetch:federated-content` is uncached, and the tasks that read its output use `jit` inputs. - **`www`:** - `build` depends on `docs#build:guides-markdown`, so federated content is fetched once instead of twice. - `build:next` is folded into `build`. - `typecheck` runs `next typegen` itself. - `turbo-build.test.ts` is updated for the new task graph. It reads `PATH` through a copy of the env, because `turbo/no-undeclared-env-vars` flags it once the `passThroughEnv: ["*"]` wildcard is gone. - `passThroughEnv: ["*"]` is gone, and the env vars the content scripts read are declared. - **`studio`:** `typecheck` runs `next typegen` inline, and `lint` depends on a new `lint:type-checks` task. The `predev` turbopack cache clean moved into `scripts/dispatch.js`. It's a local side effect, and making it a turbo task would route `dev` through turbo's strict env filtering, which drops `NODE_ENV`, `MODE` and `STUDIO_FRAMEWORK`. ## Review instructions - For each app, check that a second `pnpm build` hits the cache. `www`'s fetch and content tasks re-run by design, since they're uncached. - Not verified: the `www` and `studio` dev servers started from the repo root, a Studio production build, the e2e flow, and runs with real production credentials. - `kb`'s build reads a remote database that turbo can't hash. It stays cached, keyed on `SUPABASE_URL`. Say if you'd rather make it uncached. - Builds rewrite two tracked files, `apps/docs/public/markdown/manifest.json` and `apps/www/public/customers-rss.xml`, so a fresh checkout can miss the cache once. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
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`). |
||
|
|
e0816d183d |
chore(www) - tweaks for conversion on products / feature pages (#53173)
## Problem Low conversion rate for high SEO traffic pages (`/database`, `/features/sql-editor`, etc). ## Solution - For product pages, changing the button variant for `Start your project` to be `primary`, more visually eye-catching. This is the primary human CTA for the page, so should stand out more. - For `feature` pages, adding a manually specified line delimiter where we can inject a CTA button. Again, these are the primary purpose of the page for human readers, `hey, go try out this thing`, so we should optimize for this a bit more. We'd likely want to take a different approach if we apply this to _all_ feature pages, but this seems fine for an initial test here. Also, while I was in here, added a bunch of empty `blogURL` values for feature pages. ## Preview links ### product pages https://zone-www-dot-com-git-kody-devrel-822-sql-editor-8236e1-supabase.vercel.app/database <img width="1219" height="541" alt="Image" src="https://github.com/user-attachments/assets/67708db7-615f-4bba-aeeb-8647222ea2f3" /> ### feature pages https://zone-www-dot-com-git-kody-devrel-822-sql-editor-8236e1-supabase.vercel.app/features/sql-editor <img width="1219" height="968" alt="Image" src="https://github.com/user-attachments/assets/bbf69d91-0316-47c8-a279-a5d41131f830" /> |
||
|
|
66a262a64b | chore(kb) - messaging tweak based on internal convo (#53181) | ||
|
|
cedb3efb8b |
content(kb) - realtime provider listicle (#52980)
## Content Realtime providers listicle ## Preview link https://kb-git-kody-devrel-807-realtime-provider-listicle-supabase.vercel.app/kb/guides/best-realtime-providers |
||
|
|
7ad4dd071b |
chore(ui-library) - explicitly allow bots (#53183)
Follow up to #52567, as crawlers are still getting blocked on x-robots-tag headers |
||
|
|
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>
|
||
|
|
ba94909a8c |
feat(design-system): trace waterfall, ruler, grid and cursor (#52158)
## Problem We're adding tracing UI primitives to the design system as building blocks for future trace waterfalls. This is PR 2 in a stack of small, component-by-component PRs. PR 1 added the data layer, and this one adds the first visible pieces: the waterfall container and the time ruler. It also creates the Tracing docs page. Part of [DEBUG-243](https://linear.app/supabase/issue/DEBUG-243/tracing-ui-primitives-stacked-prs) ## Solution Adds `Trace.Waterfall`, `Trace.Ruler`, `Trace.Grid` and `Trace.Cursor`. - `Trace.Waterfall` measures its own width and provides the time scale to the primitives inside it. Three columns: the tree (`treeWidth`, default 320), the timeline, and a controls gutter (`controlsWidth`, default 56). Both widths are exposed as CSS variables and subtracted from the scale width, so everything shares one layout. No rounded corners. - `Trace.Ruler` is the time axis: a "SPAN" label over the tree column, ticks that adapt to the visible range, and the gutter, which renders the Ruler's children (for icon controls). - `Trace.Grid` draws a vertical gridline at every ruler tick, from the same `scale.ticks`. It's one non-scrolling overlay below the ruler that fills the timeline column, so rows added later sit on top. - `Trace.Cursor` draws the live cursor, a line from the top of the ruler to the bottom of the waterfall with a dot on the ruler's bottom edge. It shows while the trace is live and inside the visible window. Ticks, gridlines and the cursor share one live-growth transition that respects reduced motion. - `createTimeScale` also returns the ticks, and `utils.ts` gains `niceTickStep` and `formatMs`. Tick labels pick their precision per unit, so 1.2s and 1.4s don't both read "1s". - New design-system page, Tracing, with an intro and one example showing a finished trace and a live trace. `ComponentPreview` gets an optional `squared` prop, used only by this page, to remove the preview's rounded top corners. Rows, bars, markers, the minimap and the inspector come in later PRs, so the timeline is empty apart from the ruler. ## Additional context This is PR 2 of a stack, so it builds on `kemal/debug-243-1-trace-foundation` and PR 3 builds on this branch. The earlier exploration is in the draft #51184, which stays open as reference until the stack lands. ## Review instructions 1. Open the preview link and find the Tracing page under UI Patterns. 2. In the first example, check the ruler ticks and labels across the trace duration, and that the labels read sensibly (for example 1.2s and 1.4s stay distinct). 3. In the live example, check the "now" line sits at about the halfway point, and that it's not drawn when `nowMs` falls outside the visible range. 4. Resize the window and check the ticks re-measure and re-space. 5. Switch between light and dark mode and check the ticks, labels and now line are legible in both. 6. Read `Waterfall.tsx` and the additions to `utils.ts`. Run the Trace unit tests in `packages/ui-patterns`, which cover the tick step and formatting logic, and run typecheck and Prettier. |
||
|
|
79763687f7 |
Include command section for event tracking in cmd k (#53205)
## Context Just updating Cmd K to include a `command_section` within the `command_menu_command_clicked` event action's properties, mainly to let us identify which section the clicked command came from. For e.g with the recent resource aware Cmd K changes, this will allow us to identify whether "Related resources" command items are being used, `command_section` will be set as "Related resources" <img width="500" alt="image" src="https://github.com/user-attachments/assets/3ab67df1-4a35-4ab0-9c12-6621a0a0fe8f" /> Or for searching database entities, clicking on each command item within their sections will set `command_section` as `"Tables" | "Policies" | "Triggers" | "Functions"` <img width="500" alt="image" src="https://github.com/user-attachments/assets/b0ba9cd7-d2ed-4ee6-8aae-c7fe8157f340" /> |
||
|
|
1f85678060 |
chore: update cli config schemas (#53161)
Updates the published JSON Schemas from the supabase/cli release workflow. Generated by `scripts/publish-schemas.ts` in supabase/cli from `apps/docs/public/schemas` — edit the schemas there rather than this folder. Published versions below the current one are frozen and never rewritten. Auto-merge is enabled: the PR squash-merges once a reviewer approves it. Co-authored-by: github-actions[bot] <41898282+github-actions[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. |
||
|
|
bf39c95230 |
feat(design-system): trace ui foundations (#52153)
## Problem We're adding tracing UI primitives to the design system as building blocks for future trace waterfalls. This is the first PR in a stack of small PR's and it lays the data layer and foundations. It doesn't render anything yet. Part of [DEBUG-243](https://linear.app/supabase/issue/DEBUG-243/tracing-ui-primitives-stacked-prs) ## Solution Adds the span types, the trace index and `Trace.Root`: - OpenTelemetry-compatible span types (trace id, span id, parent span id, name, start/end, status, attributes, events). - `buildTraceIndex` and the time-to-position scale that later primitives share. - `Trace.Root`, which provides the index through context. It's the only UI export in this PR. - Three additions to the index: - `isLive`: true if any span is still running (`endMs === null`). - `minRangeMs`: an optional `Trace.Root` prop that sets a floor on the visible duration while the trace is live. - `slowestId`: the id of the longest finished span (first encountered wins ties), or `null` if there is none. Everything visual (Waterfall, Ruler, Rows, Bar, Minimap, Inspector and so on) comes in the PRs after this one. There are no visual changes here, so no screenshots. ## Additional context This is PR 1 of a stack, so later PRs build on this branch. The earlier exploration is in the draft #51184, which stays open as reference until the stack lands. ## Review instructions Nothing renders in this PR, so review is code-only. 1. Read the span types and check they cover the OpenTelemetry fields listed above. 2. Read `buildTraceIndex` and check `isLive`, the `minRangeMs` floor and `slowestId` against the descriptions above. The floor should only apply while the trace is live, and a running span should never be picked as slowest. 3. Run the Trace unit tests in `packages/ui-patterns` and check they pass. The new cases cover `isLive`, `minRangeMs` and `slowestId`. 4. Run typecheck and lint for the package. |
||
|
|
6236fa4ec5 |
chore: remove the Cloudflare R2 asset upload and asset CDN (#53148)
Removes the dead Cloudflare R2 asset upload and asset CDN code from Studio, docs and www. Every app now behaves as it did with `FORCE_ASSET_CDN=-1`: Vercel serves assets from the default path. Also fixes `.github/workflows/zizmor.yml` to download zizmor with `gh release download`: `curl -sSLO` saved GitHub error pages as the archive, which broke the attestation check. > [!WARNING] > Remove `FORCE_ASSET_CDN` from Vercel only after this deploys. **Worth a close look** - `apps/studio/vite.config.ts`: `SKIP_ASSET_UPLOAD` is kept because it still gates Sentry source map upload. - `apps/studio/turbo.jsonc`: `AWS_ACCESS_KEY_ID` / `AWS_SECRET_ACCESS_KEY` are kept because the Bedrock credential chain (`lib/ai/bedrock.ts`) can fall back to them. ## To test - [ ] On the Vercel previews for studio, docs and www, open a page with DevTools: JS, CSS and fonts load from the app's own origin (`/dashboard/assets/…` or `/dashboard/_vercel/immutable/…` for Studio, `/docs/_next/static/…` for docs, `/_next/static/…` for www), with no 404s or CSP errors in the console. --------- Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com> |
||
|
|
e6b433661c |
Remove account:show_security_settings from enabled-features.json (#53198)
## Context As per PR title - usage of this flag was previously removed [here](https://github.com/supabase/supabase/pull/52358) |
||
|
|
c1b32d9596 |
chore(www): ignore browser-extension noise in Sentry (#53200)
## Problem The www browser Sentry client reports errors that come from browser extensions, not from site code. One example is `Invalid call to runtime.sendMessage(). Tab not found.`, which is raised by the extension messaging API (`chrome.runtime` / `browser.runtime`). Site code never calls that API. Studio and docs already ignore known browser noise through the shared `BROWSER_NOISE_IGNORE_ERRORS` list, but www does not use that list. ## Solution - `packages/common/sentry.ts`: add `/Invalid call to runtime\.sendMessage\(\)/` to `BROWSER_NOISE_IGNORE_ERRORS`, under the browser-extension section. Studio and docs pick it up too. - `apps/www/instrumentation-client.ts`: pass `BROWSER_NOISE_IGNORE_ERRORS` as `ignoreErrors`, the same way docs does. www now ignores the shared network, extension, non-Error and cross-origin script noise too. - `apps/www/lib/sentry-capture.test.tsx`: add a test that an error with this message is not sent. ## How to verify This change has no UI. Check it with these commands: - `pnpm --filter www exec vitest run --config vitest.sentry.config.mts`: all tests pass, including "does not send browser extension messaging errors". - `pnpm --filter common exec vitest run sentry.test.ts` passes. - `pnpm turbo run typecheck --filter='...[origin/master]'` and `pnpm turbo run lint --filter='[origin/master]'` pass. The full typecheck run ran out of memory on `studio#typecheck` once. Run again on its own with `--filter=studio`, it passed. Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> |
||
|
|
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> |
||
|
|
b9fd4f8bdf |
Fix TS (#53189)
### Context Just fixing TS issues from merging this [PR](https://github.com/supabase/supabase/issues/53079) |
||
|
|
2ecd504df8 |
docs: add Nick Clark to humans.txt (#53187)
## Problem Add Nick Clark to the Supabase team list in `apps/docs/public/humans.txt`. ## Solution Insert the name in alphabetical order between Nick B and Nick Littman. ## Review instructions 1. Open `apps/docs/public/humans.txt`. 2. Confirm `Nick Clark` appears once, between Nick B and Nick Littman. ## Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md). - [x] This change does not add or edit a docs topic. ## Self-review - Verified the one-line diff and ran `git diff --check`. - No build or tests were run for this static text entry. Co-authored-by: Nick Clark <nick.clark@supabase.io> Co-authored-by: Cursor <cursoragent@cursor.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. |
||
|
|
c62f07f940 |
fix(kb): ai tools events (#53180)
## Problem - kb guide sidebar shows the AI tools block from docs, with the same shared `AiTools` component - docs sends `agent_setup_clicked`, `copy_as_markdown_clicked` and `ask_ai_clicked` from that block, but kb sends no event for any click ## Solution - adds the docs events to the kb AI tools block, so a kb click sends the same event as a docs click - adds `kb` to the `pageType` values, because the kb sidebar also shows on troubleshooting pages, so `guide` is not correct - changes `agent_setup_clicked` to send with `keepalive`, because the connect link opens a page in the same tab and the browser can cancel the request - moves the kb telemetry sender to one module, so kb search and the sidebar use the same platform and consent checks - adds a test that clicks each AI tools item and checks the event that kb sends <!-- ## 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. run `pnpm --filter kb test`, and make sure that `GuideSidebar.test.tsx` and `KbSearch.test.tsx` pass 2. open [/kb/guides/best-supabase-auth-providers](https://kb-git-antlio-fix-kb-ai-tools-event-supabase.vercel.app/kb/guides/best-supabase-auth-providers) and accept the cookie banner 3. open the browser network panel, turn on "Preserve log" and filter the requests by `telemetry/event` 4. click "Copy as Markdown", "Ask ChatGPT" and "Ask Claude" in the AI tools block 5. make sure that each click sends one request, and that `custom_properties` has `pageType: "kb"` and `platform: "kb"` 6. go back to the guide and click "Connect your AI agent" 7. make sure that the log shows one `agent_setup_clicked` request after the docs page opens 8. search for a term in the kb header, and make sure that `kb_search_submitted` still sends ## 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) |
||
|
|
04a58c8d8f |
fix(common): ignore trailing slashes in ensurePlatformSuffix (#53065)
## Problem `ensurePlatformSuffix` appends `/platform` to the API URL as-is. With `NEXT_PUBLIC_API_URL` set to `https://api.supabase.com/` (trailing slash), the kb search events from #52981 post to `https://api.supabase.com//platform/telemetry/event`, which returns 404. Nothing logs it, because the kb send path swallows errors. Related: DOCS-1580 ## Solution Strip all trailing slashes before checking for or adding `/platform`, using a loop instead of a regex (CodeQL flagged `/\/+$/` as polynomial). `https://api.supabase.com/`, `//`, `.../platform`, `.../platform/` and `.../platform//` now all resolve to `https://api.supabase.com/platform`. ## Review instructions 1. In `packages/common`, run `pnpm vitest run telemetry-event.test.ts`. The new trailing-slash case fails on master and passes here. |
||
|
|
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) |
||
|
|
f082d3d93d |
docs: fix typo 'thier' -> 'their' in ionic-angular example README (#53120)
One-word typo fix in `examples/user-management/ionic-angular-user-management/README.md`. Co-authored-by: xyonx-bot <xyonx-bot@users.noreply.github.com> |
||
|
|
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) |