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 | |
|---|---|---|---|---|
|
|
f0f2b57939 |
test(telemetry): cover every ad click id in first-touch attribution (#51774)
## Problem
The ad click ids we send to PostHog for first-touch attribution have no
direct tests. A typo in a param name (say `getParam('opref')`) would
silently drop that click id and CI would stay green. Also, nothing in CI
ran `packages/common` tests at all, apart from `sentry.test.ts`.
GROWTH-1326.
## Solution
- First-touch click ids are now one exported list,
`FIRST_TOUCH_CLICK_ID_KEYS`, instead of 11 hand-written `getParam`
lines. Same ids, same output.
- New `telemetry.test.ts` checks that list equals `CLICK_ID_KEYS` plus
`bfcid`, and that every id in it comes back from
`getFirstTouchAttributionProps`.
- `first-referrer-cookie.test.ts` checks `buildFirstReferrerData`
extracts every `CLICK_ID_KEYS` entry, and that `bfcid` stays out of that
pre-consent list.
- Added a `test` script to `packages/common` and a `pnpm --filter common
test` step to `library-tests.yml`, which already triggers on
`packages/common/**`.
## Review instructions
1. Check the Library checks job runs the common tests (13 files).
2. Add a made-up id to `FIRST_TOUCH_CLICK_ID_KEYS` only, then run `pnpm
--filter common test`. It fails.
## 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)
|
||
|
|
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 |
||
|
|
0208c0b242 |
feat(studio): send the platform marker on flag tracking calls (#53165)
I changed Studio's feature-flag tracking call to send `platform: 'studio'`, so `$feature_flag_called` events captured by the management API carry the same app marker as Studio's other events (#53078). I held this step back until the API's strict flag-track body schema accepted the field in production, which it has since 2026-11-09. **Note:** I regenerated `packages/api-types` with a full `codegen:prod` run, so it also includes other recent production API additions. The `verify-production-api-types` check diffs every type file against production, so a single-type update would fail it. ## To test Accept the cookie banner first: flag tracking only fires after consent. Tested on the PR preview: - [x] Sign in to the studio-staging preview, open any project page, and find the `POST /platform/telemetry/feature-flags/track` request in DevTools: expect the body to include `"platform":"studio"` and a 2xx response (a 400 means the field was rejected). Observed `{"feature_flag_name":"proBenefitWording","feature_flag_value":"variant-a","platform":"studio"}` with a 201, and every `/platform/telemetry/feature-flags` GET returned 200. ## Linear - fixes GROWTH-1461 |
||
|
|
529ca5aa1d |
fix(studio): update CPU usage docs link FE-4820 (#53168)
## Problem The CPU usage info icon was reported to open a 404 page. Its chart definition points to the former telemetry reports URL, which currently redirects to the observability guide. ## Fix Link directly to the CPU usage section at `/guides/observability/reports#cpu-usage`. ## How to test - Open the Database report and click the info icon next to CPU usage. - Expected result: the Reports guide opens at the CPU usage section. Verified this interaction in the Studio staging preview for commit `316d6a8ae87d52ba3d338da2151c1d7dd99d6339`. Prettier, typecheck/lint, lint ratchet, and all four Studio unit-test shards pass in CI. Local report tests and ESLint were blocked by missing installed dependencies (`effect` and `@eslint/compat`). No new test was added for a static URL change. |
||
|
|
bc9d68a813 |
fix(studio): handle architecture-prefixed Postgres versions in version helpers (#53162)
## Problem `getDatabaseMajorVersion` and `getSemanticVersion` in `apps/studio/lib/helpers.ts` returned `NaN` for Postgres versions with an architecture prefix, e.g. `supabase-postgres-arm64-17.9.0.019` (expected 17 / 1790019). `parseAppVersionKey` already handled `arm64-` and `x86_64-`, but the two helpers did not. Fixes FE-4974 Closes #53109 ## Solution - `formatSemver` now strips any leading architecture token (`^[a-z][a-z0-9_]*-`) rather than a hardcoded list. A version segment always starts with a digit, so this covers `arm`, `arm64`, `x86_64`, `aarch64`, `amd64` and future values. - `APP_VERSION_KEY_RE` in `useSelectedProject.utils.ts` uses the same rule, so the two parsers stay consistent. - Because the rule is generic, strings like `supabase-postgres-custom-123` would otherwise parse as a number. `formatSemver` now rejects anything that doesn't look like `\d+.\d+` after stripping, and both helpers return `0` for it (matching their existing empty-string behavior). Callers only compare the result numerically, so `0` behaves like the previous `NaN`. Tests cover each prefix on both helpers and on `parseAppVersionKey`, a release suffix (`-vault-rc1`), and non-version strings. Not changed: `getSemanticVersion` concatenates segments without padding (`17.10.0.001` becomes 171001, which compares below `17.9.0.019`). That predates this change and its callers pin to a single major line. |
||
|
|
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. |
||
|
|
11a71d795a |
chore(docs): replace pnpm lifecycle hooks with turbo task dependencies (#52556)
## Problem `apps/docs` ordered its build, dev and codegen steps with pnpm `pre`/`post` hooks and `&&` chains. Turbo couldn't see those steps, so it couldn't cache or parallelize them, and running the build through turbo ran the codegen twice. Part of [FE-4948](https://linear.app/supabase/issue/FE-4948/migrate-the-pnpm-scripts-to-use-turbo). ## Solution The ordering now lives in `apps/docs/turbo.jsonc` as `dependsOn`, and every pre/post hook is gone. The new `maybe-turbo` workspace bin runs a script through `turbo run` unless it's already inside turbo, so `pnpm build`, `pnpm dev`, `pnpm codegen:references` and the other entry points keep running their prerequisites. Turbo is bumped to 2.11.10 for its `jit` input mode. Tasks downstream of the uncached remote fetches use it to hash the gitignored files those fetches write after they finish, so a cache hit can't restore output built from older content. Strict-mode env vars are declared. Other changes: - The R2 upload moves from `postbuild` to the `vercel.json` build command, so it still runs when the build is a cache hit. - `codegen:references:new:ensure` re-downloads when any JavaScript TypeDoc dump is missing or empty. - The guides manifest is now sorted, so its output is deterministic. - A new `turbo-scripts` agent skill (listed in `AGENTS.md`) documents these conventions for every app. Its audit script, `node .agents/skills/turbo-scripts/scripts/audit.mjs apps/<name>`, flags scripts that need `maybe-turbo`, leftover `pre`/`post` hooks, script chains, and wrapped scripts without a turbo task. ## Review instructions 1. Read `packages/maybe-turbo/README.md`, `apps/docs/turbo.jsonc` and `.agents/skills/turbo-scripts/SKILL.md`. 2. From `apps/docs`, set `GH_TOKEN=$(gh auth token)` for the federated fetch and run `pnpm run build:markdown` a few times. Once warm, every task except `build:federated-content` and `codegen:references:new:ensure` should hit the cache. 3. Run `pnpm build` from `apps/docs` and check that the docs Vercel preview deploys and renders normally. ## 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) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> |
||
|
|
5a3e1fd871 |
docs(logs): document unified CLI logs DEBUG-267 (#53086)
## Problem The unified CLI logs commands need a public guide. The existing SQL guide also says the CLI cannot query hosted ClickHouse logs, which is only true for v2. ## Fix Add **Logs in the CLI** to the Observability navigation and overview cards. Cover local and remote queries, filters and time ranges, interactive versus JSON output, exports, SQL, command options, migration, and troubleshooting. Include screenshots of the explorer and full record details using demo local logs. Keep the v2 CLI reference unchanged and update links from the existing logs and SQL guides. Merge after the CLI version with unified logs is released. Tracks [DEBUG-267](https://linear.app/supabase/issue/DEBUG-267) and [DEBUG-268](https://linear.app/supabase/issue/DEBUG-268). ## How to test Open `/docs/guides/observability/cli-logs` in the preview. Check the section order, images, option tables, and links from Observability, Logs in Studio, and Query logs with SQL. Local examples were verified using the CLI PR build and retained log fixtures. Hosted examples were checked against the implementation but were not rerun against a live project for this docs change. ## Screenshots Explorer showing demo local logs:  Full selected record:  |
||
|
|
e04c556bd5 |
feat(studio): add the issues list (#52990)
Add the Issues list, URL filters, and overview counts with complete advisor refresh handling. |
||
|
|
22c3587058 |
fix(studio): add sqlOrigin and queryName to row large values query (#53164)
## What Fixes the Studio typecheck failure on `master`. #53091 (copy large values when duplicating a row) added an `executeSql` call in `row-large-values-query.ts`. #53059 (split SQL errors into user and Studio SQL) made `sqlOrigin` and `queryName` required. Each PR passed CI by itself, but together they break typecheck. This PR adds the two fields, following the pattern used in the other `data/table-rows` queries. ## Verification - `pnpm typecheck` passes (17/17 tasks) |
||
|
|
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. |
||
|
|
170dcfc9a0 |
content(kb) - queues listicle (#52982)
## Context Queues provider listicle ## Preview links https://kb-git-kody-devrel-804-queues-listicle-supabase.vercel.app/kb/guides/best-queue-providers --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> |
||
|
|
3ad7cccbf5 |
chore: update cli reference doc (#49619)
Updates the CLI reference from the supabase/cli release workflow. Generated by `scripts/generate-docs-spec.ts` in supabase/cli — edit the command tree or the content under `apps/cli/docs/` there rather than this file. New commands also need an entry in `apps/docs/spec/common-cli-sections.json` — without one a command's page is silently dropped from the docs site. Sections fixes can be committed directly onto this branch — later releases add commits on top instead of rewriting it. --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Julien Goux <hi@jgoux.dev> Co-authored-by: Ali Waseem <waseema393@gmail.com> |
||
|
|
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 |
||
|
|
d69d8e1bc1 |
fix(studio): retry empty JSON GET responses without the HTTP cache (#53089)
## Problem
Successful GET requests sometimes reach Studio as a `200` with an empty
body. The fetcher turns these into `data: {}`, which doesn't match the
generated types, so components crash on nested reads such as
`pages[0].pagination.count`, `project.ref` and `features.vectorBuckets`.
Sentry diagnostics from #51123 show:
- Nearly all of these events come from Firefox.
- A `cache: 'no-store'` refetch of the same request returns a normal
body in more than 99% of events, so the API isn't sending empty
responses.
- The API sends no `Cache-Control` and a weak ETag, so Firefox
revalidates stored entries with `If-None-Match`. A browser cache or
revalidation bug is the most likely cause, but it isn't proven.
## Solution
When a successful response has an empty body,
`normalizeEmptyBodyResponse` now tries to recover it before falling back
to `{}`:
1. If only the clone used for the peek was empty, it reads the original
response and uses that body.
2. For JSON GET requests, it re-fetches once with `cache: 'no-store'`
and a new `X-Request-Id`, using plain `fetch` so the middleware can't
recurse. The retry uses the query's abort signal. A `2xx` response with
a body is returned to the caller.
3. Otherwise it keeps today's behavior: `Content-Length: 0`, which gives
`data: {}`.
The retry only covers GET requests with an `application/json` response,
so these stay unchanged:
- empty mutation responses
- the branch diff endpoint, which legitimately returns an empty
`text/html` body when there's no diff
The retry replaces the diagnostic probe, so a failure costs two requests
instead of three. The Sentry report gets a new `recovered_by` tag
(`original_body`, `refetch` or `none`), which will show whether the fix
works and whether the clone or the cache was at fault. The existing
`probe_*` fields keep their names, and Sentry still only receives body
lengths, never bodies.
### Why not bypass the cache for every request?
We chose not to send every request with `cache: 'no-store'`. It would
remove every `304 Not Modified` response, so unchanged data would come
back as a full `200` body each time and more data would go over the
network. The retry keeps HTTP caching for normal requests and only skips
the cache for requests that already came back empty.
## How to test
- `pnpm vitest run data/empty-body-diagnostics.test.ts
data/normalizeEmptyBodyResponse.test.ts` from `apps/studio` covers:
- refetch recovery, and the secret value never reaching Sentry
- fallbacks when the retry is empty, rejects, returns non-2xx or is
aborted
- no retry for non-JSON responses or non-GET requests
- the original-body path
- After release, check the `recovered_by` tag on the "Empty response
body on successful API request" Sentry issues, and confirm the related
crash issues (`pagination is undefined`, `can't access property "ref"`)
trend down.
Part of FE-4665
Related to FE-4912
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
||
|
|
a1538e957b |
feat(www): advertise the AI catalog from the homepage (#53153)
I added an AI catalog pointer to the homepage, following agentready.org practice AR-FIND-04: a `<link rel="ai-catalog">` tag in the head and a matching entry in the existing `Link` header on `/`. I also bumped the MCP server card from 0.15.0 to 0.16.1, the latest `@supabase/mcp-server-supabase` release. **Note:** Both point at `/.well-known/ai-catalog.json`, the path the spec names, which is our rewrite alias for `ard.json`. ## To test Tested on the PR preview: - [x] `curl -sI <preview>/`, expect a `link` header carrying both `rel="api-catalog"` and `rel="ai-catalog"` - [x] `curl -s <preview>/`, expect `<link rel="ai-catalog" href="/.well-known/ai-catalog.json"/>` before `</head>` - [x] `curl -s <preview>/.well-known/mcp/server-card.json`, expect `"version": "0.16.1"` ## Linear - fixes GROWTH-1469 |
||
|
|
9fd979e20a |
Added myself to humans.txt (#53066)
## Problem I have a task in my onboarding hub ## Solution Added myself to humans.txt ## 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) |
||
|
|
032f0d0710 |
fix: broken links from the Web 404 Review, week of 2026-11-02 (#53144)
<!-- claude-slack-attribution --> _Requested via [Slack thread](https://supabase.slack.com/archives/C076KTY11DF/p1794189210976169?thread_ts=1794189210.976169&cid=C076KTY11DF)_ ## Problem The Web 404 Review for the week of 2026-11-02 flagged these paths as returning 404: - `/docs/guides/local-development/cli/customizing-email-templates`: the guide moved out of `cli/` and the old path has no redirect. - `/docs/swift/javascript/auth-mfa-enroll`: the Swift v1 and v2 `mfa.challengeAndVerify()` notes link to this malformed path. - `/docs/guides/database/triggers`: the guide moved to `/docs/guides/database/postgres/triggers` and the old path has no redirect. - `/docs/guides/local-development/cli/managing-config`: the guide moved out of `cli/`. Its sibling paths (`cli/managing-environments`, `cli/migrations`, `cli/seeding-your-database`) already redirect, this one was missed. ## Solution One commit per fix, so any fix can be dropped by reverting its commit: - `/docs/guides/local-development/cli/customizing-email-templates`: permanent redirect to `/docs/guides/local-development/customizing-email-templates` in `apps/docs/lib/redirects/static-redirects.json`. - `/docs/swift/javascript/auth-mfa-enroll`: link changed to `/docs/reference/swift/auth-mfa-enroll` in `apps/docs/spec/supabase_swift_v1.yml` and `apps/docs/spec/supabase_swift_v2.yml`, matching the other languages and the sibling `mfa.challenge()` note. - `/docs/guides/database/triggers`: permanent redirect to `/docs/guides/database/postgres/triggers` in `static-redirects.json`. - `/docs/guides/local-development/cli/managing-config`: permanent redirect to `/docs/guides/local-development/managing-config` in `static-redirects.json`, next to its siblings. All redirect targets exist in `apps/docs/content/guides`. `node apps/docs/scripts/generate-static-redirects-md-variants.mjs` runs clean with the new entries. ## Review instructions Open each path in the To test list on the docs preview and check the result. ## To test - [x] Open `/docs/guides/local-development/cli/customizing-email-templates`: redirects to `/docs/guides/local-development/customizing-email-templates`. 308, target returns 200. - [x] Open `/docs/reference/swift/auth-mfa-challengeandverify` and `/docs/reference/swift/v1/auth-mfa-challengeandverify`: the "enrolled factor" link goes to `/docs/reference/swift/auth-mfa-enroll`. Both pages, target returns 200, no `/docs/swift/javascript/` hrefs remain. The v1 page linking to the latest enroll page matches the other v1 specs (Dart, Kotlin) and the sibling `challenge()` note. - [x] Open `/docs/guides/database/triggers`: redirects to `/docs/guides/database/postgres/triggers`. 308, target returns 200. - [x] Open `/docs/guides/local-development/cli/managing-config`: redirects to `/docs/guides/local-development/managing-config`. 308, target returns 200. - [x] Sibling redirect `/docs/guides/local-development/cli/managing-environments` still goes to `/docs/guides/deployment/managing-environments` (200). - [x] Markdown variant `/docs/guides/database/triggers.md` redirects to `/docs/guides/database/postgres/triggers.md` (308, 200). - [x] The three redirect targets load directly with no further redirect. ## 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) ## Linear - fixes GROWTH-1459 --- _Generated by [Claude Code](https://claude.ai/code/session_011aGhSA9eHLKUDz5xbi7tY2)_ --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
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. |
||
|
|
1d31266c82 |
fix(docs): stop sending Ask AI question text to telemetry (#53142)
<!-- claude-slack-attribution --> _Requested via [Slack thread](https://supabase.slack.com/archives/C076KTY11DF/p1794187436590809?thread_ts=1794187436.590809&cid=C076KTY11DF)_ ## Problem **Before:** `docs_search_v2_ask_ai_question_submitted` sent the user's Ask AI question, cut to its first 300 characters, as a `question` property (added in #52459). Free-text questions can contain personal data such as names, emails, pasted logs, or connection strings. **After:** the event sends only `questionLength` and `questionSource`. No question text leaves the browser. This matches `kb_search_submitted`, which already leaves the query text out and sends only its length. Linear: [GROWTH-1458](https://linear.app/supabase/issue/GROWTH-1458/stop-sending-ask-ai-question-text-in-docs-search-v2-ask-ai-question) ## Solution - `packages/common/telemetry-constants.ts`: remove `question` from `DocsSearchV2AskAiQuestionSubmittedEvent` and note in the event doc that the question text is left out, as `KbSearchSubmittedEvent` does. - `apps/docs/features/SearchV2/AskAiPanel.tsx` (typed questions) and `SearchV2Provider.tsx` (questions carried over from search): drop the `question` property. - `apps/docs/features/SearchV2/constants.ts`: delete `ASK_AI_QUESTION_TELEMETRY_LENGTH`, which nothing uses now. - `SearchV2.telemetry.test.tsx`: replace the truncation test with one that checks a typed question sends exactly `{ questionLength, questionSource: 'typed' }`, has no `question` property, and does not contain the question text. Out of scope: `docs_search_v2_search_submitted.query` and `docs_search_v2_result_clicked.query` stay as they are. ## Review instructions 1. Check that the event type in `telemetry-constants.ts` no longer has `question`, and that typecheck enforces this at both call sites. 2. Run `pnpm vitest --run features/SearchV2` in `apps/docs`. All 33 tests pass locally. 3. `tsc --noEmit` passes in `apps/docs` (after `codegen:graphql`) and `packages/common`. Prettier is clean on changed files. ## 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) (not applicable: no docs content changed) --- _Generated by [Claude Code](https://claude.ai/code/session_011aGhSD3LLt9nZYbsWkZBjJ)_ Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
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. |
||
|
|
edc09b78ae |
Add go page: aws-reinvent/schedule (#53063)
## Problem We want a landing page where people can book 1:1 time with the Supabase team at AWS re:Invent 2026. ## Solution - Adds a go page at `/go/aws-reinvent/schedule` using the existing `hubspot-meeting` section, modeled on the Stripe Sessions scheduler page. Registered in `apps/www/_go/index.tsx` with a removal date of Dec 31, 2026. - Adds three entries to `apps/www/lib/authors.json` with headshots under `apps/www/public/images/blog/avatars/`. - Adds `whitespace-pre-line` to the go hero `<h1>` so a title can contain a line break. No existing go page title contains a newline, so other pages should not change. ## Review instructions 1. Open the preview at `/go/aws-reinvent/schedule`. 2. Check the hero copy, including the line breaks in the title and description. 3. Confirm the scheduler loads and shows availability. 4. Check `HeroSection.tsx` for the `whitespace-pre-line` change. ## 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 (not applicable) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Wendie Cheung <wendie.cheung@supabase.io> Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
6f1e7516bf |
kb: add BetterAuth with Supabase CLI migrations article (#53072)
## Problem Adds a new article covering how to use Supabase native database migrations with BetterAuth to add BetterAuth to a Supabase project. ## Preview links https://kb-git-tylershukert-devrel-599-supabase-better-d064e1-supabase.vercel.app/kb/guides/setup-better-auth-with-declarative-schema ## 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) --------- Co-authored-by: Kody Jackson <kody.jackson@supabase.io> |
||
|
|
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. |
||
|
|
d862ac18f2 |
feat(telemetry): stamp the app's platform on every event (#53078)
Every first-party PostHog event now carries a `platform` property naming
the supabase.com app that sent it. Each app passes its directory name
(`studio`, `www`, `docs`, `kb`, `learn`, `ui-library`) once at telemetry
setup, and I stamp it on both send paths.
**Changed:**
- **Events sent through the Management API**
(`/platform/telemetry/event`): `buildTelemetryEventRequest` adds
`platform` to `custom_properties`. This also covers kb's search events,
which build the request without `sendTelemetryEvent`.
- **Events sent by posthog-js** (pageviews, page leaves, identify,
experiment exposures): a `before_send` hook stamps `platform` at send
time.
- **App setup**: `PageTelemetry` takes a required `platform` prop, and
kb's island sets the value directly. While unset, the property is left
off instead of defaulting to an app.
**Note:** I used `before_send` instead of `posthog.register()`. Super
properties persist in localStorage, which every supabase.com app shares,
so events sent before `register()` runs would carry the previous app's
value.
**Do not merge yet.** Studio's `trackFeatureFlag` body still needs
`platform`. That commit waits for the Management API change that accepts
the field to reach production, plus an `api-types` regen. The flag-track
body is strict, so sending `platform` early returns 400 on every flag
call.
## To test
On each app's preview, accept cookies and add `?__posthog_debug=true` to
the URL.
- [x] Studio: load a page, expect `$pageview` with `properties.platform:
"studio"` (seen at ingestion: the staging PostHog project has
`$pageview` and `$pageleave` events from the studio-staging preview
host, all with `platform: "studio"`)
- [x] www: load the homepage, expect `send "$pageview"` with `platform:
"www"`; click "Start your project", expect the
`/platform/telemetry/event` request body to have
`custom_properties.platform: "www"` (both seen)
- [x] docs: load a guide, expect `send "$pageview"` with `platform:
"docs"` (seen); added: "Copy as Markdown" sends `custom_properties:
{"pageType":"guide","platform":"docs"}`
- [x] kb: load a page, expect `send "$pageview"` with `platform: "kb"`;
run a search, expect the `/platform/telemetry/event` body to have
`custom_properties.platform: "kb"` (seen on both `kb_search_submitted`
and `kb_search_result_clicked`)
- [ ] learn and ui-library: load a page, expect `send "$pageview"` with
`platform: "learn"` and `"ui-library"` respectively. Not checkable on
previews: learn has no preview deployment, and the ui-library preview
host is not on the consent provider's allowlist, so telemetry never
starts there.
- [x] Added, negative check: on docs, kb and www, no captured posthog-js
event had `platform` unset or set to another app
- [x] Added, ingestion: in the staging PostHog project,
`copy_as_markdown_clicked` (docs) and `start_project_button_clicked`
(www) carry `platform` as a top-level event property
## Linear
- fixes GROWTH-1450
|
||
|
|
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. |
||
|
|
dc73b346c1 |
docs: document feature flags and experiments for PMs (#53067)
## Problem PMs want to ship docs changes behind feature flags and A/B test them. Only code comments and old PR descriptions (#52049, #52191) document how. ## Solution - `apps/docs/CONTRIBUTING.md` (with a pointer from the root file): says that docs supports flags and A/B tests, and whom to contact. The internal how-to is in Notion. - `ask-the-docs`: new `reference/feature-flags.md` covers the static and PostHog flag systems, the variant hook pattern, and gotchas. - `pm-the-docs`: sends flag requests to Docs Engineering. People outside Supabase also use these skills, so the flag content fails gracefully for them. ## Test plan - [x] Prettier passes on the changed files. - [x] Every cited code path exists on master. - [ ] The root `CONTRIBUTING.md` anchor link resolves after the merge. --------- Co-authored-by: Nik Richers <nik@validmind.ai> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
396358c7cb |
chore(docs,www) - added, deleted, redirected URLs (#53097)
## Problem added, deleted, redirected URLs + urls for new blog posts ## Preview links N/A --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
b1f49edc3b |
docs: revise Option 1 placements from the tree test results (#52969)
Closes DOCS-1473 Closes DOCS-1578 ## Problem The [tree test results on the live trees](https://app.notion.com/p/40e5004b775f811b91bed8f7c76ac7f6) found four tasks where agents look in a different place from where Option 1 puts the page: - **Shared responsibility:** agents look in Security and compliance. The page is under Deploy to production, and every arm failed the task. - **RLS testing:** agents look in Local Development and CLI. The page is under Database. - **Project transfer:** with two levels visible, agents open Team, because the task is about organizations. - **Leaked API key:** with two levels visible, agents see Start's "API keys" and choose it. The rotation page sits a level deeper, under Security and compliance. ## Solution Revises four Option 1 placements and labels. Option 1 only. Today's nav, page content, and URLs don't change. No subheads. | Task | Change | | --- | --- | | Shared responsibility | Moved from Deploy to production to Security and compliance › Compliance. The `docs:compliance` flag moves to the SOC 2, HIPAA, and GDPR items so the page shows in every build. | | RLS testing | New Testing group under Local Development and CLI, with Overview, Test RLS policies with pgTAP, Testing your database, and pgTAP advanced guide. Database's Testing group goes away. | | Project transfer | "Projects, compute and scaling" becomes "Projects, organizations and compute", in the sidebar and the top nav. "Transfer Project" becomes "Transfer to another organization". | | Leaked API key | Start's "API keys and key rotation" becomes an "API keys" group with two pages: API keys, and Rotate a leaked API key. The rotation page moves out of Security and compliance. | Each page keeps one home. Every level stays at 7 items or fewer, 5 levels at most, and labels at 35 characters or fewer. In the tree test on this preview, all four tasks now pass with no wrong turns at two levels. Set-aside tasks score 83% against Option 1's 71% at two levels, and the same within noise at one level. ## Preview links | Site | Live | Preview | Search for | | --- | --- | --- | --- | | Docs | Not live until supabase/supabase#52735 merges | [/docs/nav-tree.json](https://docs-git-docs-ia-option-1-placement-revisions-supabase.vercel.app/docs/nav-tree.json?docs-ia-mvp-v1=option-1) | Rotate a leaked API key | ## Additional context - **The leaked-key move trades views.** With two levels visible, as in the top nav dropdown, agents choose the rotation page in 3 of 3 runs, up from 0. With one level at a time, as on mobile, they look in Security and compliance first and find it in 0 of 3, down from 3. A follow-up link from the Security and compliance hub to the rotation page would help one-level readers without listing the page twice. - **Set-aside tasks:** the shared responsibility and project transfer cases are set-aside tasks. A gain on either can't count as unseen-task evidence. Only a fresh holdout set can confirm it. ## Review instructions 1. Open `/docs/nav-tree.json?docs-ia-mvp-v1=option-1` on the preview. Check that each moved page appears once, under its new parent. 2. Open `/docs/nav-tree.json` without the parameter. Check that it matches supabase/supabase#52737's. 3. Open `/docs?docs-ia-mvp-v1=option-1` on the preview and hover Start. Check that API keys shows as a group with Rotate a leaked API key inside. ## 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) |
||
|
|
f59c795eb5 |
feat(docs): render Option 1 on the server when the variant is forced (#52735)
Closes DOCS-1520 ## Problem The original PR was only client-side. This is adding server-side integration. The docs-nav evals fetch each page's HTML with no JavaScript and add `?docs-ia-mvp-v1=option-1` to every request. The option-1 arm gets the control navigation anyway. Guide pages are statically generated, so the server can't read the query parameter. `useIaNavVariant` reads the override from the URL after the page loads, so the fetched HTML always has today's nav, hidden with an `invisible` class. The top nav dropdowns have a second gap. Their panels mount on the client, so their links are not in the server HTML for either variant. Every eval case starts at `/docs`, where those links are the only way into the Option 1 groups. ## Solution - **Rewrite option-1 requests:** `proxy.ts` sends `/docs` and guide pages with `?docs-ia-mvp-v1=option-1` to `/docs/ia/option-1/…`. Pages there render on the first request and are then cached, so nothing is added to the build. Requests without the parameter, and `.md` requests, are not rewritten. - **Read the variant from the route:** `IaNavRouteProvider`, in the root layout, reads the variant from the layout segments. `useIaNavVariant` returns it on the server and records no PostHog exposure for it. `useIaNavReady` is ready at once, so the nav has no `invisible` class. - **Strip the route prefix:** on the server, `usePathname` returns the rewritten path. The nav components, breadcrumbs, and `AiTools` use `useDocsPathname`, which strips the `/ia/option-1` prefix. - **Breadcrumbs follow the variant:** they resolve from the visitor's nav config, not always today's. - **Top nav subheads in the HTML:** a `<noscript>` block next to the top nav lists the dropdown links for the visitor's variant, inside an `sr-only` nav. Browsers with JavaScript ignore it. - **No index for the route:** direct visits to `/docs/ia/option-1/…` get `noindex`. Canonical URLs point to the real guide. **Not changed:** - **Reference pages:** they keep today's nav, even with the parameter. - **Config pages:** the five generated config pages under `self-hosting` and `local-development/cli` are not in the markdown manifest, so they keep today's nav too. - **Links:** they don't carry the query parameter, so a click in the browser leaves the forced variant. This was already the case before this PR. - **Conflicts with #52679:** it changes the same hooks. Whichever PR merges second needs a rebase. ## Review instructions `grep -c` counts the lines of server HTML that contain the text. A count of 1 or more means the text is in the HTML that an agent fetches without JavaScript. A count of 0 means it is not. 1. Run `curl -s "https://docs-git-docs-ia-option-1-server-render-supabase.vercel.app/docs/guides/auth/sessions?docs-ia-mvp-v1=option-1" | grep -c "Run and manage"`. The count is 1 or more. "Run and manage" is an Option 1 top nav label, so this checks that the parameter gets Option 1's nav from the server. 2. Run `curl -s "https://docs-git-docs-ia-option-1-server-render-supabase.vercel.app/docs/guides/auth/sessions" | grep -c "Run and manage"`. The count is 0. This checks that a request without the parameter still gets today's nav. 3. Run `curl -s "https://docs-git-docs-ia-option-1-server-render-supabase.vercel.app/docs?docs-ia-mvp-v1=option-1" | grep -c "guides/platform/ssl-enforcement"`. The count is 1 or more. The home page has no sidebar, and this link sits only in the "Run and manage" dropdown, so this checks that the top nav subhead links are in the server HTML. 4. Run `curl -s -o /dev/null -w "%{http_code}" "https://docs-git-docs-ia-option-1-server-render-supabase.vercel.app/docs/guides/auth.md?docs-ia-mvp-v1=option-1"`. It returns `200`. This checks that the markdown version still loads with the parameter. 5. Open [/docs/guides/auth](https://docs-git-docs-ia-option-1-server-render-supabase.vercel.app/docs/guides/auth) in a browser and hover over the top nav. You see today's nav and dropdowns. ## 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) |
||
|
|
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) |
||
|
|
fcd79b69eb |
chore(docs): webhook secret leak documentation
Document the new events we recently shipped that fire when a credential is leaked belonging to a project/org. PR: https://github.com/supabase/supabase/pull/53000 Co-authored-by: Paweł Gulbinowicz <pawel.gulbinowicz@supabase.io> |
||
|
|
a7649ec1ce |
content(kb) - passwordless auth providers (#52566)
## Problem Listicle on passwordless auth providers ## Preview links https://kb-git-kody-devrel-800-passwordless-auth-providers-supabase.vercel.app/kb/guides/best-passwordless-auth-providers |
||
|
|
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 |
||
|
|
2fd66161ea |
docs(www): remove "no data-transfer tax" claim from compute FAQ (#53084)
<!-- claude-slack-attribution --> _Requested by **Kalleby Santos, Bruno Kilian** · [Slack thread](https://supabase.slack.com/archives/C0BB4MAJW58/p1791486981400579?thread_ts=1791486981.400579&cid=C0BB4MAJW58)_ ## Problem The "Can I attach a persistent disk?" FAQ answer on /compute says Postgres and Supabase Storage are reachable with "no data-transfer tax". That is not accurate: Compute reaches Storage through the Cloudflare/API gateway, so egress still applies. **Before:** "...use your Postgres database for structured data and Supabase Storage for files — both reachable with near-zero intra-region latency and no data-transfer tax. Mountable persistent disks are on the roadmap." **After:** "...use your Postgres database for structured data and Supabase Storage for files, both reachable with near-zero intra-region latency. Mountable persistent disks are on the roadmap." ## Solution Remove the "no data-transfer tax" claim from `apps/www/app/(products)/compute/_components/FAQSection.tsx` and swap the em dash for a comma in the clause being edited. No other copy changes. Kalleby Santos (@kallebysantos) is credited as co-author via a `Co-authored-by` trailer on the commit. ## Review instructions 1. Open `/compute` and expand "Can I attach a persistent disk?". 2. Confirm the answer no longer mentions data-transfer costs. --- _Generated by [Claude Code](https://claude.ai/code/session_01M8V2QPNwybc8GJg94K3TX9)_ Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Kalleby Santos <105971119+kallebysantos@users.noreply.github.com> |
||
|
|
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 |
||
|
|
e91fa7a3d6 | [FE-4755] fix(studio): skip per-asset resource spans on TanStack build (#53076) | ||
|
|
5191874237 |
fix(www): docs prefetch (#52700)
## Problem - link prefetch on `supabase.com/docs` returns 404 - a prefetch of `/docs/guides/auth/architecture` returns 404 through www and 200 on the docs deployment - the www rewrite forwards the request as `<page>.segments/_tree.segment.rsc` and keeps the prefetch header, so docs adds the suffix again - likely happened after next 16 migrations ## Solution - adds www rewrites that forward a docs prefetch as the page path, so docs adds the `.segments` suffix one time - fixes client navigation to the docs home, because docs serves its root as `index.rsc` and www asked for `docs.rsc` - adds a test that fails when a docs prefetch path reaches the generic `/docs/:path*` rule first | build | click before the prefetch ends | click after the prefetch ends | | --- | --- | --- | | before (`supabase.com`) | 106 to 146 ms | 102 to 137 ms, the prefetch returns 404 so the click sends a request | | after (preview with this fix) | 124 to 169 ms | **14 to 46 ms**, the click sends no request | | check | before | after | | --- | --- | --- | | segment prefetch of a guide page | 404 | 200 | | segment prefetch of the docs home | 404 | 200 | | client navigation to the docs home (`RSC: 1`) | 404 | 200 | | probe checks that pass | 4 of 8 | 8 of 8 | each run used a fresh browser profile and started on `/docs/guides/auth/passwords`. each click went to the same 4 sidebar links, which start out of view. the time stops when the new `h1` shows. the after numbers come from a test preview of www with this fix, which forwards to the same docs deployment <!-- ## 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 the `/docs` rewrites run only in production builds, so steps 4 to 7 use `supabase.com` 1. run `pnpm --filter www exec vitest run next.config.test.ts` and make sure that all tests pass 2. run `git checkout origin/master -- apps/www/lib/rewrites.js`, run the test again and make sure that the new test fails 3. run `git checkout HEAD -- apps/www/lib/rewrites.js` to restore the fix 4. before the deploy, run the command below and make sure that it prints `404` ```sh curl -s -o /dev/null -w '%{http_code}\n' -H 'RSC: 1' -H 'Next-Router-Prefetch: 1' -H 'Next-Router-Segment-Prefetch: /_tree' https://supabase.com/docs/guides/auth/architecture ``` 5. after the deploy, run the same command and make sure that it prints `200` 6. after the deploy, run `curl -s -o /dev/null -w '%{http_code}\n' -H 'RSC: 1' https://supabase.com/docs` and make sure that it prints `200` 7. open [/docs/guides/auth](https://supabase.com/docs/guides/auth), click a sidebar link and make sure that the page opens without a full reload ## 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) |
||
|
|
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. |
||
|
|
b04118b0e6 |
[FE-4885] feat(www,docs): add InstantDB migration page to sitemap, docs (#53074)
Makes the InstantDB migration page discoverable. It's served through a rewrite, so it has no page file for the sitemap to find, and it serves as its own docs, so there's no separate guide to link to. **Added:** - `https://supabase.com/migrate/instantdb` in the www sitemap, alongside the other proxied apps - InstantDB card in the "Migrate to Supabase" listing on `/docs/guides/resources` The card has no icon because the repo has no InstantDB logo. Adding one later would also put it in the docs home migration grid. ## Tested locally Sitemap and docs listing tests pass, and ESLint and Prettier are clean on the touched files. The generator outputs the URL once, as valid XML. `tsc` in `apps/docs` only failed on the missing `__generated__/graphql` module since codegen wasn't run. ## To test - `/docs/guides/resources` on the docs preview: card shows in "Migrate to Supabase" and links to the migration page - `/sitemap_www.xml` on the www preview includes `/migrate/instantdb` --------- Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com> |