mirror of
https://github.com/supabase/supabase.git
synced 2026-12-05 16:09:06 +00:00
create-pull-request/patch
7336
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
607dc2bfde |
Chore/cleanup dead code in project branch selector (#52691)
## Context
Just some housekeeping here while going through the repo, realised that
there's dead code in `ProjectBranchSwitcher`
## Changes involved:
- `ProjectBranchSelector` is only rendered by `MobileNavigationBar`,
which `DefaultLayout` only mounts when `useBreakpoint('md')` is true.
The selector's own `isMobile` check used the same breakpoint, so its
desktop `Popover` branch could never run.
- The name `ProjectBranchSelector` is also misleading since the sheet
switches more than just the project's branch + it's mobile-only, so
opting to rename it to `MobileProjectSwitcher` instead
- Also fix org rows in the sheet being tighter than project rows.
`compactPadding` was inverted, so the embedded list got `p-0.5` on the
item and lost the default `px-2 py-1.5`
- Align buttons in `ProjectBranchSelector` across all tabs + use outline
variant for secondary action
| Previous | Updated |
|---|---|
| <img width="352" height="174" alt="image"
src="https://github.com/user-attachments/assets/24cb2985-b568-4bc1-8f53-ab3914ef0804"
/> | <img width="351" height="161" alt="image"
src="https://github.com/user-attachments/assets/e6e9b0e9-c075-4235-93ca-80c5d070c287"
/> |
| <img width="336" height="248" alt="image"
src="https://github.com/user-attachments/assets/4071b73f-f741-4598-ba01-8dc7bb6ba57a"
/> | <img width="335" height="313" alt="image"
src="https://github.com/user-attachments/assets/2bea398d-ebe9-4641-9bfe-c4a7b6b10c51"
/> |
If you meant a different table, tell me what the two columns should be.
For example, file and change, or before and after behaviour.
|
||
|
|
5a1e59eb2e |
docs: add Claude as ID-JAG issuer for MCP Enterprise-Managed Auth (#52021)
## Problem Anthropic now lets Claude issue the ID-JAG for enterprise-managed MCP auth when a customer's identity provider can't. No Supabase code change is needed: the platform already validates ID-JAGs against whichever issuer URL the organization configures. The page called the feature "enterprise-managed authentication." It implements the MCP spec's Enterprise-Managed Authorization extension and is built on an RFC 7523 authorization grant. Authentication stays with the IdP. The Studio field description had the same wrong word. ## Solution **New section, "Using Claude as the ID-JAG issuer."** Covers the Claude-side steps (Organization settings > Connectors > Supabase > Managed authorization > Set up, copy the Issuer URL, leave Tenant ID empty), the Supabase-side step (same ID-JAG Issuer field), and the connection test. Two constraints were verified against our platform code: one issuer per SSO provider so the Claude URL replaces the IdP URL and members need an SSO identity in Supabase. The third, that a Claude-issued ID-JAG attests Claude-org membership rather than an IdP session, comes from Anthropic's partner guide. **Rename to "enterprise-managed authorization."** Page title, headings, body, SSO guide section, nav label (title case, matching sibling entries), and the Studio description. The slug moves to `enterprise-mcp-authorization` with a permanent redirect from the old path in `apps/www/lib/redirects.js`. The Studio "Learn more" link and the two published blog posts that linked the page point at the new slug directly. ## 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: Ana <30495040+ana1337x@users.noreply.github.com> Co-authored-by: Ana <ana1337x@users.noreply.github.com> |
||
|
|
07dbe3ce1d |
fix(studio): use raw object count as storage pagination offset (#52706)
## Problem Studio Storage hides `.emptyFolderPlaceholder` objects after listing a folder, but `fetchMoreFolderContents` calculated the next page offset from the number of visible items. When a page includes the placeholder, the API returns 200 objects but Studio keeps 199, so the next request uses offset 199 instead of 200 and the last file of the previous page appears twice. The duplicates compound with every further page. Fixes FE-4843. Closes #52607. Before: <img width="521" height="458" alt="Screenshot 2026-11-03 at 14 51 09" src="https://github.com/user-attachments/assets/1ed20ded-08c6-4c56-92d7-5c97ef82cd00" /> After: <img width="532" height="460" alt="Screenshot 2026-11-03 at 14 53 58" src="https://github.com/user-attachments/assets/64891f27-7fa0-44cb-8076-39b405df0ee4" /> ## Solution Each storage column now records `hiddenItemsCount`, the number of API objects hidden from the visible list (the placeholder). `fetchMoreFolderContents` offsets the next page by `items.length + hiddenItemsCount`. Because the offset is still derived from `items.length`, local edits to a column (creating a folder, uploads, deletes, renames) keep it in step with the server, as they did before. Added tests to `state/storage-explorer.test.ts`: a folder with a placeholder plus 300 files lists each file exactly once and requests offsets 0 and 200, and a folder without a placeholder still pages at 0, 200, 400. Reverting the offset line makes the placeholder test fail. ## Review instructions 1. In a bucket, create a `docs` folder and, using the Storage API, upload a zero-byte `docs/.emptyFolderPlaceholder` plus files `file-000.txt` through `file-299.txt`. 2. Open `docs` in Studio and sort by Name ascending. 3. Scroll to load further pages and check the list requests in the network tab: offsets should be 0 and 200, and no file should appear twice. 4. Run `pnpm --filter studio exec vitest run state/storage-explorer.test.ts`. ## 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) |
||
|
|
df742bdb3b |
refactor(studio): rename ResponseError to StudioError (#52707)
## What
Moves the `ResponseError` class (`types/base.ts`) and the classified
error classes (`types/api-errors.ts`) into
`lib/errors/studio-errors.ts`, and renames `ResponseError` to
`StudioError`.
## Why
Studio's error classification is being expanded to cover errors that
don't come from API responses (thrown network failures, aborted
requests, unexpected client errors). The API-specific name and location
no longer fit. Landing the rename on its own keeps the follow-up PR,
which introduces the classified error model, small and reviewable.
## Notes for reviewers
- Mechanical change, no behavior change. Most of the diff is a one-line
import change per file plus import re-sorting by Prettier.
- Files that only use the type now use `import type { StudioError }`.
- `ResponseError` is no longer re-exported from `@/types`; there are no
compatibility shims at the old paths.
- Unrelated identifiers like `QueryResponseError` and
`parseResponseErrors` are unchanged.
|
||
|
|
53e2c4f1d1 |
[FE-4809] fix(studio): group HA topology by shardRef (#52545)
Update HA topology grouping for the Multigres JSON field rename from `shardKey` to `shardRef`, so separate shards retain their own primaries and replicas. **Changed:** - Normalize pooler responses to `shardRef`, falling back to legacy `shardKey` and preferring `shardRef` when both exist. - Use `shardRef` in the topology selector and shard grouping. **Added:** - Regression coverage from response parsing through diagram node/edge generation for new, legacy, mixed, and conflicting key formats, plus omitted shard identity fields. Addresses https://linear.app/supabase/issue/FE-4809/update-studio-ha-topology-grouping-to-use-shardref ## To test - Open Settings → Infrastructure on a multi-shard HA project returning `shardRef`. Confirm one group per shard, each primary shown as Primary Database, and replicas connected only to their own shard's primary. - Check the same topology on Database → Pipelines. - Confirm legacy `shardKey` responses still render correctly and single-shard projects remain unchanged. ## Validation - Passed: 33 targeted utility tests, ESLint on all changed files, Studio TypeScript check, and diff whitespace checks. - Local browser: login and non-HA infrastructure passed. HA grouping remains unverified because local poolers/gateways endpoints returned 404; browser response mocking was blocked by cross-origin/CORS limitations. - Upstream multigres/multigres#1608 merged October 29; deployment of the renamed field remains unconfirmed. Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com> Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> |
||
|
|
9b7cbd1803 |
feat(studio): migrate branches to FGA grants with production/development variants (#52331)
## Problem Branch actions in Studio were guarded by hand-written permission checks (`useAsyncCheckPermissionsV2(FGA_PERMISSIONS.PROJECT.BRANCHING_*)`, plus one legacy `useAsyncCheckPermissions` in `Branch.Commands.tsx`) that weren't tied to the endpoints they protect. Every branches request in `data/branches` was marked `unguarded.migrating`. This is the pilot migration for endpoint-bound FGA grants. Resolves [FE-4693](https://linear.app/supabase/issue/FE-4693/pilot-migrate-branches-to-grants-8-endpoints-createbranchmodal). ## Solution ### Data layer * `data/branches` has no `unguarded.migrating` left (was 10). * The list, detail, and diff queries are now `branchesQueryOptions`, `branchQueryOptions`, and `branchDiffQueryOptions`. They take a grant, use `skipToken` without one, and keep the grant out of the query key. * Mutations take the grant in their variables. The merge mutation also takes `diffGrant`, because it reads the diff before merging. ### Production and development variants The backend doesn't treat development and production branching permissions as interchangeable: * Actions on a single branch (`/v1/branches/{branch_id_or_ref}` and its diff, merge, push, reset, and restore) need the production permission for the default branch and the development permission for preview branches. * Creating a default branch or a branch with data needs production create. To model this, `lib/fga-refinements.ts` gets its first entries: * The 8 single-branch endpoints have `production` and `development` variants. A new `variantRequired` flag makes the fetch wrapper reject a grant without a variant, at compile time and in `assertGrant`. * `POST /v1/projects/{ref}/branches` has a `production` variant. `assertGrant` requires it when the body sets `is_default` or `with_data`. * `useBranchGrant(endpoint, { projectRef, isDefault })` picks the variant from the branch's `is_default`. It stays `loading` until the branch is known. * `GrantForVariants<M, P>` types a grant for any of an endpoint's variants. ### UI * The old checks are replaced with grants in `CreateBranchButton`, `CreateBranchModal`, `Overview`, `DeleteBranchPanel`, `DeleteBranchModal`, the branches and merge-requests pages, and `Branch.Commands.tsx`. * Grants are evaluated against the parent project, where branch permissions live. The scope is passed explicitly, because `/v1/branches/*` paths don't include the project. * Pages that are mainly about branches show `NoPermission` when the grant is denied and `AlertError` when the permission check fails. Action buttons are disabled with a tooltip. Places that use the branch list incidentally (nav, project home, usage) treat a denied grant as "no branches" instead of loading forever. * "Include data" in `CreateBranchModal` is disabled without production create. It previously failed after submitting. * `OutOfDateNotice`'s "Update branch" is disabled without the push grant. It previously did nothing. * The GitHub integration form blocks saving without the production-branch grant. Previously the connection was saved while the branch request failed, and a repo change deleted the old connection first. ### Where the old checks differed from the backend * **Too strict:** the branches and merge-requests pages required development read, and the create button required development create. The backend accepts development or production for both. * **Wrong for the default branch:** single-branch actions always checked development permissions, or production write for the main branch menu, regardless of which branch was targeted. * **Missing:** reset and "Switch to persistent" in `Overview` had no check. * **Legacy check:** `Branch.Commands.tsx` used the legacy `CREATE preview_branches` check. `BranchingPITRNotice` is unchanged: its check guards a subscription update, not a branches request. ### Other changes * The two new query options use an `eslint-disable` for `@tanstack/query/exhaustive-deps`, because grants stay out of query keys. A separate PR upgrades the plugin and allowlists `grant`, after which these can be removed. * `upsertMigration` in the merge mutation still uses `unguarded.migrating`. It belongs to the database-migrations domain. ## Testing * New component tests for `CreateBranchButton`, `DeleteBranchPanel`, the branches page, and `GitHubIntegrationConnectionForm` cover granted, denied, and error states. * New `useBranchGrant` tests: default vs. preview branch, and loading until the branch is known. * `guarded-fetch.test.ts` covers required variants (types and runtime) and the production variant for default and data branches. * Shared fixtures are in `tests/lib/branch-test-utils.ts`. * Studio typecheck passes, affected suites pass, the ESLint ratchet is stable, and knip is clean. |
||
|
|
83ccea9d87 |
feat(dash) - allow indexing of sign-up and sign-in pages (#52650)
## Problem Large search volume hitting the following terms that don't have a good user click path: - `supabase login` (~200K clicks per 3 months), `Supabase dashboard` (~30K clicks per 3 months). There's no user click path here :( <img width="1905" height="3560" alt="image" src="https://github.com/user-attachments/assets/7aafc9e5-dd20-459b-b2bb-4044ec4158f5" /> - `sign up for Supabase` (~2,800 clicks last 3 months). Also no user click path here :( <img width="1905" height="3966" alt="image" src="https://github.com/user-attachments/assets/d7ed4f45-acaf-4b48-a63a-c62abf2221fb" /> ## Solution 3 things: - Allows indexing of `sign up` and `sign in` pages - Adds some metadata to help with navigation. - Adds 2 dash pages to the www sitemap ## Preview links - [www sitemap](https://zone-www-dot-28buthwge-supabase.vercel.app/sitemap_www.xml) <img width="869" height="182" alt="image" src="https://github.com/user-attachments/assets/3ba31a99-2cfa-4db4-80f4-cd5f41603f9c" /> - [sign up page](https://studio-staging-m4ylh7sp9-supabase.vercel.app/dashboard/sign-up) <img width="1531" height="828" alt="image" src="https://github.com/user-attachments/assets/73e6dad3-9653-4db7-a035-c8b9827cf3f9" /> - [sign in page](https://studio-staging-m4ylh7sp9-supabase.vercel.app/dashboard/sign-in) <img width="1531" height="828" alt="image" src="https://github.com/user-attachments/assets/c4d56a22-c0ab-49b5-a6ed-8b835aa4d52e" /> |
||
|
|
5912394ffc |
chore(studio): improve object versioning feature preview (#52689)
Improve copywriting and add image for the Storage Object Versioning feature preview. |Before | After | |--|--| | <img width="1096" height="717" alt="Screenshot 2026-11-03 at 11 05 30" src="https://github.com/user-attachments/assets/88a7f13e-4762-48cd-89db-57e2c51f7613" /> | <img width="1075" height="693" alt="Screenshot 2026-11-03 at 11 06 28" src="https://github.com/user-attachments/assets/bab3a2ef-f8bf-4188-865a-701e482347f1" /> | ## How to review 1. Open `Storage object versioning` feature preview 2. See feature preview 3. Acknowledge feature preview 4. Approve --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> |
||
|
|
929af55026 |
fix(studio): stop csp-blocked images from failing feedback screenshots (#52590)
## Problem - "Capture screenshot" in the studio feedback widget fails in production, and studio shows the "Failed to capture screenshot" toast - `html-to-image` downloads each image with `fetch()`, and the csp `connect-src` does not allow the github and google avatar hosts - the blocked avatar gets an empty `src`, so its `onerror` rejects the whole capture ## Solution - changes the capture to use a transparent pixel for each image that it cannot download, so a blocked avatar shows blank and the screenshot still completes | state | preview | | -------|------| | before | <img width="600" height="280" alt="image" src="https://github.com/user-attachments/assets/53c5916e-cd37-4fb5-8989-070537aa9f76" /> | <!-- ## Preview links If relevant, include links to changed pages for easy review access. Copy the preview base URL from the Vercel bot comment on this PR. Use the following table as an example template. | Site | Live | Preview | Search for | | -------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | ----------------------------- | | WWW | [/blog/your-post](https://supabase.com/blog/your-post) | [/blog/your-post](https://zone-www-dot-com-git-branch-name-supabase.vercel.app/blog/your-post) | unique phrase from the change | | Docs | [/docs/guides/your-page](https://supabase.com/docs/guides/your-page) | [/docs/guides/your-page](https://docs-git-branch-name-supabase.vercel.app/docs/guides/your-page) | unique phrase from the change | | Studio | [/dashboard](https://supabase.com/dashboard) | [/dashboard](https://studio-git-branch-name-supabase.vercel.app/dashboard) | unique phrase from the change | | Design system | [/design-system](https://supabase.com/design-system) | [/design-system](https://design-system-git-branch-name-supabase.vercel.app/design-system) | unique phrase from the change | | UI library | [/library](https://supabase.com/library) | [/library](https://ui-library-git-branch-name-supabase.vercel.app/library) | unique phrase from the change | | Knowledge base | [/kb/guides/your-page](https://supabase.com/kb/guides/your-page) | [/kb/guides/your-page](https://kb-git-branch-name-supabase.vercel.app/kb/guides/your-page) | unique phrase from the change | --> <!-- ## Additional context Optionally add any other context or screenshots. --> ## Review instructions 1. open [/dashboard](https://studio-git-antlio-fix-studio-feedback-screenshot-supabase.vercel.app/dashboard) and sign in with an account that has a github or google avatar 2. click "Feedback" in the top bar, click the image button, and click "Capture screenshot" 3. capturing works and "Failed to capture screenshot" toast does not show 4. click the thumbnail, and make sure that the page shows in the screenshot with a blank area where the avatar is ## Checklist Check all before review: - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [ ] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) --------- Co-authored-by: Joshen Lim <joshenlimek@gmail.com> |
||
|
|
7c52a9b539 |
Joshenlim/fe 3931 re phone mfa enrollment repeatedly force disabled despite (#52629)
## Context In Authentication -> Multi Factor, if you've set SMS MFA to any status apart from "Disabled" and refresh the page, the UI seemingly doesn't render the right value in the dropdown as such: <img width="1114" height="160" alt="image" src="https://github.com/user-attachments/assets/d3353628-0b9a-4347-b81f-3a968a87b5c2" /> Was happening as the form mounted with placeholder values (for SMS MFA, default status was "Disabled"), and the real value was only applied afterwards by a `useEffect` which called `reset`. This changed the `Select`'s value after mount, in Radix then fires an event on that change through `onValueChange` which set `value` as an empty string `''`. It happens as well for TOTP, if you set any value other than "Enabled" which is the default status. ## Changes involved - Am also opting to breakdown `MfaAuthSettingsForm.tsx` into smaller components as it's a single file handling 3 different forms at the moment - (Main fix) Derive the form values via `defaultValue` instead of via `useEffect` which prevents the unintended firing of `onValueChange` for the `Select` |
||
|
|
b9a2422deb |
fix(pipelines): Fix data loading issue in Pipelines (#52642)
Co-authored-by: Joshen Lim <joshenlimek@gmail.com> |
||
|
|
5dfd86d35c |
fix: regressed studio typecheck performance (#52677)
Heads up: Generated with Claude Opus 5.5 CheckedInit made TypeScript infer each call's init through conditional and Omit types over the full API paths, at every typed get/post/put/ patch/del call site. A cold `tsc --noEmit` spent 92s type-checking and peaked at 17 GB of memory. CheckedUrl already rejects missing, mismatched, and unexpected grants, so the init check was redundant. Remove CheckedInit and ParseAsContext (which only worked around CheckedInit breaking parseAs inference) and type init the way openapi-fetch does. Cold check time: 92s -> 5.4s. Instantiations: 34.9M -> 16.4M. Peak memory: 17.3 GB -> 5.5 GB. All guarded-fetch type tests still fail for the same reasons. |
||
|
|
7bb6e13aa8 |
Include existing postgres config params in PUT payload (#52675)
## Context The PUT `database/postgres` endpoint does a full resource override for the project's Postgres config. The only surface in the dashboard that does requests to PUT `database/postgres` is under Database -> Settings -> Log connections, but the dashboard only sends `log_connections` and `log_disconnections` when updating the settings here, resulting in existing config values being over written. Fix here is to merge the existing Postgres config values in the PUT payload |
||
|
|
ab60ab2684 |
Fix ProjectLayout side nav width changes after opening and closing inline SQL Editor (#52623)
## Context Happens in the ProjectLayout when the side navigation menu's width can be resized (Table Editor / SQL Editor) On those pages, if you were to toggle the inline SQL Editor with Cmd+E, the side navigation menu's width will change to fit the max width once the inline SQL Editor is closed, and its happening due to the library's default behaviour for handling nested resizable groups. The fix was to bump `react-resizable-panel` to `4.7.x` which introduced a new property `groupResizeBehaviour` and allows us to set that prop's value as `preseve-pixel-size` for the `ProjectLayout` since we use pixel values in this context for the panel widths. Same fix also applied for `FilterSideBar` which is used in Unified Logs |
||
|
|
90c3e57e05 | feat(studio): realtime health advisors (#52535) | ||
|
|
7439ae34d1 |
Fix update role panel not scrollable (#52621)
## Context Under organization -> team member settings, when managing a member's access (specifically if the access is project-scoped), the list of projects is not scrollable at the moment if there's a lot of projects, so this PR addresses that, as well as cleans up a couple of small UI issues that I found while investigating. Screenshot here just shows which UI i'm referring to but you'll need to have a lot of projects to reproduce this <img width="1099" height="492" alt="image" src="https://github.com/user-attachments/assets/73c6db27-9ae8-479b-b2cc-2b6b0d322ff6" /> |
||
|
|
8be85ad4ad |
feat(studio): guard branch update and push with FGA grants (#52377)
Part 6 of 7 in a stack that splits #52331 into reviewable pieces. Resolves part of [FE-4693](https://linear.app/supabase/issue/FE-4693/pilot-migrate-branches-to-grants-8-endpoints-createbranchmodal). There are no functional changes beyond #52331, and the top of the stack is identical to it. See #52331 for the full rationale. ## Stack 1. #52372 Grant infra for branch variants 2. #52373 Branches list query 3. #52374 Page gates on the list grant 4. #52375 Branch creation 5. #52376 Branch read, delete, reset, and restore 6. 👉 #52377 Branch update and push 7. #52378 Branch diff and merge ## Changes The update and push mutations take grants. `Overview` (including "Switch to persistent", which previously had no check), `EditBranchModal`, `SwitchToPreviewModal`, `MergeRequestButton`, the merge-requests page, and the merge page use `useBranchGrant`. The "Update branch" button in `OutOfDateNotice` is disabled without push; previously it did nothing. The GitHub integration form blocks saving without the production-branch grant. Previously the connection was saved even when the branch request failed. ## Testing New `GitHubIntegrationConnectionForm` test. |
||
|
|
86848fc036 |
docs: move the production security checklist to its own page (#52466)
Closes DOCS-1494 ## Problem The Security section of the Production checklist is split out as a part of the Information Architecture plan laid out in Option 1 of the [Docs navigation architecture proposal](https://app.notion.com/p/supabase/Q4-2027-Proposal-Docs-navigation-architecture-3f25004b775f81f49dbad710a732ef61). ## Solution - **Structure:** move `## Security` to `guides/security/production-checklist`. The production checklist keeps the heading, and its `#security` anchor, with a one-sentence pointer. The page is in the Security sidebar under Guides, after Production Checklist. - **Option 1 navigation:** the "Production security checklist" entry in Run and manage, Security and compliance, points to the new page. The Option 1 test no longer expects the anchor. - **Page shape:** a value-statement opener with the situations that call for the checklist, then the items grouped under Database, Account and organization, Auth, and Threat review. Each group opens with a lead-in that says what its checks protect. - **Inbound links:** two Studio linter entries for OTP settings, the Studio Auth providers form, and `auth/auth-email-passwordless` now point to `production-checklist#auth`. The password length lint points to the password security guide instead, since the checklist has no password item. They used to land on `going-into-prod#security`, which is a pointer now. - **Claim fixes:** - The replication item told readers to enable replication on sensitive tables. It now says to enable RLS on replicated tables that hold sensitive data. - The Auth items named **Authentication > Providers**. The Dashboard label is **Sign In / Providers**. - **Terminal path:** the Auth group links the Management API endpoint for its settings. The Database items link to guides that carry CLI or SQL paths. - **Review fixes:** a note that RLS doesn't filter Postgres Changes `DELETE` events, a SQL path for publications, and the other email links the OTP expiry controls. - **Agent prompt:** after the opener, a copyable `AiPrompt` that has an agent audit the project read-only and report each item as pass, fail, or can't check. It reads Security Advisor and the tables through the Supabase MCP server, and SSL, network restrictions, Auth settings, and org members through Management API GET endpoints. `includeInMarkdown` is on, so the `.md` carries the prompt as a fenced text block. - **Cross-links:** Testing auth flows points to the checklist's Auth group, and the Security overview and Product configuration pages link the checklist. The custom SMTP item links the SMTP guide. ### Not verified - **Deferred samples:** none. The page has no code samples. - **Agent prompt:** its endpoints and fields match `api_v1_openapi.json`, and `Owner` matches Studio's role name. No agent has run it against a hosted project. - **Studio:** the link changes are strings only. Studio tests and build run on this PR because it touches `apps/studio`. ## Manual testing 1. Open [Production security checklist](https://docs-git-docs-production-security-checklist-supabase.vercel.app/docs/guides/security/production-checklist). See the agent prompt below the opener and four groups of checks. Click **Copy** and see the prompt text. 2. Open [Production checklist](https://docs-git-docs-production-security-checklist-supabase.vercel.app/docs/guides/deployment/going-into-prod#security). See the Security heading with a one-sentence pointer to the new page. 3. In the Security sidebar under Guides, click **Production security checklist**. See the new page open. |
||
|
|
38ae9fea1c |
feat(studio): add admonition for api keys settings view (#52250)
## Problem API Keys Settings view needs updating. ## Solution Added admonition with update and link to docs. |
||
|
|
5ff6930c2a |
feat(studio): send role passwords as precomputed SCRAM-SHA-256 verifiers (#52544)
## What kind of change does this PR introduce? Feature. ## What is the current behavior? Role passwords are sent as plaintext in the SQL (`create role ... password '...'` and `alter role ... password '...'`), so they can end up in Postgres logs. ## What is the new behavior? ASCII role passwords are hashed in the browser with Web Crypto and sent as a precomputed `SCRAM-SHA-256$...` verifier. Postgres stores a verifier as given, so the plaintext no longer appears in the SQL or the server logs. This applies to every flow that sets a role password, because they all go through the role create and update mutations. Non-ASCII passwords are still sent as plaintext. Postgres normalizes passwords with SASLprep before hashing, and the browser code doesn't apply it, so a verifier built from the raw text could stop the role from logging in. For ASCII, SASLprep changes nothing, so the verifier always matches. The `saslprep` package can't be used here because it reads its table with `fs.readFileSync` at import time. Covering non-ASCII passwords is a follow-up, most likely a server-side API. Studio also falls back to plaintext when `crypto.subtle` isn't available, which browsers only expose in secure contexts. This keeps setting a password working on self-hosted Studio served over plain HTTP. ## Known limitations - The verifier is built with 4096 iterations, the Postgres default. If a project sets `scram_iterations` higher, these roles keep 4096, because Postgres stores a supplied verifier as given. Reading the setting first needs an extra query and a grant for it, so it's left for the follow-up below. - Non-ASCII passwords, and Studio over plain HTTP, still send plaintext. - The follow-up is a server-side path that sets the password without it going through the SQL, which would honor the server's own settings and cover these cases. A verifier isn't secret (it can be attacked offline), but it is a clear improvement over plaintext. ## Testing - Unit tests compare the helper with an independent `node:crypto` implementation, and check that ASCII passwords become verifiers and non-ASCII passwords pass through unchanged. - I also checked against a real Postgres: roles given these verifiers log in with the plaintext password and reject a wrong one. - The `CreateRolePanel` test now expects a verifier and no plaintext in the SQL. Resolves FE-4822. |
||
|
|
b98eca75c7 |
fix(studio): give disk space warning plan-specific guidance (#52633)
The disk space warning banner showed every user the text "You can opt to increase your disk size up to 200GB on the Database Settings page". That text was wrong on three counts: 200 GB is the cap on a single automatic expansion step, the disk settings now live on the Infrastructure page, and it never mentioned that paid-plan disks already expand automatically. Users who had just received the automatic resize email couldn't tell what to do next. **Changed:** I split the banner description by plan. - **Paid plans**: the description says the disk expands automatically and points to the Infrastructure page for its current size and any limits on resizing it. - **Free Plan**: the description says the disk doesn't expand automatically and suggests freeing up space or upgrading. - **Organization still loading**: the banner falls back to a plan-neutral sentence, so a Free Plan project never flashes the paid text. **Note:** I left a manual-resize instruction out of the paid copy because the Infrastructure page blocks manual resizing above 8 GB while the spend cap is on, and blocks any resize during the cooldown after the previous one. That page explains which case applies. Spend cap is not a separate case because automatic expansion runs the same way with or without it. ## To test Setup: on a project's home page (the banner is hidden on Usage and Infrastructure), override the `GET /platform/projects-resource-warnings` response so the entry with `project: <ref>` has `"disk_space_exhaustion": "warning"`. To check both plans with one org, also override `GET /platform/organizations` to set the org's `plan.id`. I tested on the PR preview: - [x] Open a project in a paid organization, expect the banner description "Your disk expands automatically as it fills up. The Infrastructure page shows its current size and any limits on resizing it." I observed this with the org forced to `pro`; the "Check" button links to `/project/<ref>/settings/infrastructure`. - [x] Open a project in a Free Plan organization, expect "Free Plan disks don't expand automatically. Free up space, or upgrade to the Pro Plan for a disk that expands as it fills up." I observed this with the org forced to `free`. - [x] In both, expect no mention of "200GB" or "Database Settings page". - [x] With the overrides removed, expect no disk banner on a healthy project. ## Linear - part of GROWTH-1408 |
||
|
|
4a92bac8d8 |
[bot] Decrease ESLint ratchet baselines (#52597)
Automated weekly decrease of ESLint ratchet baselines. Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> |
||
|
|
298fda50dc |
feat(logs): filter by any log attribute DEBUG-223 (#52513)
Support filtering log attributes through the picker and log details, preserving filters across URLs and query surfaces. Fixes DEBUG-223. |
||
|
|
da454314b1 |
fix(studio): select the full folder name when renaming in Storage (#52594)
## Problem Renaming a Storage folder such as `photos.backup` selects only `photos`, leaving `.backup` behind when the user types a replacement name. Fixes https://github.com/supabase/supabase/issues/52593 ## Solution Apply extension-aware text selection only to files. Select the entire name for folders. Add regression tests for dotted folder names, ordinary folder names, and files with extensions. All three tests pass with the fix; the dotted-folder case fails before it. ## Review instructions 1. Create a folder named `photos.backup` in a test Storage bucket. 2. Select Rename and confirm the entire name is selected. 3. Type `archive` and confirm no `.backup` suffix remains. 4. Rename a file named `photo.png` and confirm only `photo` is selected. ## Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) |
||
|
|
1e94d386a4 |
feat(studio): add a reset password action for custom roles (#52506)
## What kind of change does this PR introduce? Feature. ## What is the current behavior? The Dashboard only offers a reset password action for the `postgres` role (Database Settings). To change the password of a custom role, users have to run `alter role ... password` in the SQL editor. ## What is the new behavior? Each role row in Database > Roles has a "Reset password" item in its actions menu. It opens a dialog with a warning that anything using the old password will be disconnected, and the shared password field (generate and copy). The password is required in this dialog. - The item is disabled for system roles, and for roles that can't log in, with a tooltip explaining why. - It uses the existing role update mutation, so no platform endpoint is involved. - `RolePasswordField` gains `isOptional` and `layout` props so the dialog can reuse it. <img width="271" height="174" alt="Screenshot 2026-11-02 at 11 11 33" src="https://github.com/user-attachments/assets/36f05fa0-e95c-440c-b6bb-4fadb466c2f6" /> <img width="543" height="414" alt="Screenshot 2026-11-02 at 11 11 17" src="https://github.com/user-attachments/assets/87ba4f50-1315-4e07-b390-9c5b6beba129" /> ## Testing New `RoleRow` component tests cover the item being available for a custom role that can log in, disabled for system roles and roles that can't log in, the required-password validation, and a successful reset. Resolves FE-4813. |
||
|
|
4810bbcfdf |
feat(studio): guard branch read, delete, reset, and restore with FGA grants (#52376)
Part 5 of 7 in a stack that splits #52331 into reviewable pieces. Resolves part of [FE-4693](https://linear.app/supabase/issue/FE-4693/pilot-migrate-branches-to-grants-8-endpoints-createbranchmodal). There are no functional changes beyond #52331, and the top of the stack is identical to it. See #52331 for the full rationale. ## Stack 1. #52372 Grant infra for branch variants 2. #52373 Branches list query 3. #52374 Page gates on the list grant 4. #52375 Branch creation 5. 👉 #52376 Branch read, delete, reset, and restore 6. #52377 Branch update and push 7. #52378 Branch diff and merge ## Changes `useBranchQuery` becomes `branchQueryOptions`. The delete, reset, and restore mutations take grants. `DeleteBranchModal`, `DeleteBranchPanel`, and the relevant `Overview` actions use `useBranchGrant`, which picks production for the default branch and development for preview branches. Reset previously had no check. ## Testing New `DeleteBranchPanel` test. |
||
|
|
be28b2517f |
fix(logs): correlate request and trace IDs DEBUG-260 (#52514)
Correlate related log timelines using request and trace IDs, and improve the Timeline empty state. Fixes DEBUG-260. |
||
|
|
7d0c1c60bd |
fix(studio): show branches page for paused branches and leave it on branch switch (#52572)
From a paused branch, "Manage branches" showed the paused screen instead of the Branches page, so the click seemed to do nothing. The next branch pick then kept the hidden `/branches` route. The Branches page now renders for paused branches, and picking a branch from the Branches pages opens that branch's home page. Fixes FE-4831 ## Testing instructions **Setup:** a project with branching enabled and at least three branches: - the default `main` branch (running) - one other running branch (`live`) - one paused branch (`paused`) Open the branch switcher with the chevron next to the branch name in the top header. **1. Manage branches from a paused branch** 1. Open `/project/<paused-ref>`. The paused state shows. 2. Open the branch switcher and click **Manage branches**. 3. Expected: the URL is `/project/<paused-ref>/branches` and the Branches page renders with the full branch list. The "project is paused" screen does not show. **2. Switching to a live branch from the Branches page** 1. Continue from step 1 (on `/project/<paused-ref>/branches`). 2. Open the branch switcher and click `live`. 3. Expected: on the first click, the URL is `/project/<live-ref>` and the live branch's project home page renders. It does not land on `/project/<live-ref>/branches`. **3. Switching straight from a paused branch (no Manage branches click first)** 1. Open `/project/<paused-ref>`. 2. Open the branch switcher and click `live`. 3. Expected: the URL is `/project/<live-ref>` on the first click. **4. Merge requests page** 1. Open `/project/<paused-ref>/branches/merge-requests`. 2. Expected: the Merge requests page renders, not the paused screen. 3. Open the branch switcher and click `live`. Expected: the URL is `/project/<live-ref>`. **5. Regression: switching branches keeps the current page elsewhere** 1. Open `/project/<live-ref>/editor` (Table Editor). 2. Open the branch switcher and click `main`. 3. Expected: the URL is `/project/<main-ref>/editor`, so the current page is kept. 4. Repeat from `/project/<live-ref>/settings/general`. Expected: `/project/<main-ref>/settings/general`. **6. Regression: paused screen still shows on other pages** 1. Open `/project/<paused-ref>/editor`. 2. Expected: the "project is paused" screen still shows. **7. Console** - During cases 1–4, there should be no unhandled errors in the console caused by the navigation itself. |
||
|
|
31c9854c2a |
chore: update api types (#52618)
Fixes API-types as per latest develop - pending prod deployment today to clear out the failing action that checks against prod types |
||
|
|
cd0b65c03e | feat(logs): Add Pipelines to unified logs and rename ETL to Pipelines (#52555) | ||
|
|
419ab63a14 |
fix(studio): report regionSelectionType 'auto' only for the Auto region option (#52283)
<!-- claude-slack-attribution --> _Requested by **Pam Chia** · [Slack thread](https://supabase.slack.com/archives/C076KTY11DF/p1792977863856759?thread_ts=1792977863.856759&cid=C076KTY11DF)_ ## Problem **Before:** `getRegionSelectionType` had an untouched-field branch that also returned `auto`, but it was unreachable: `ProjectCreationForm` passed `dirtyFields.dbRegion` (`undefined` when untouched) into an `isDbRegionDirty = true` default parameter, so the branch never fired. With the new Auto (best available) region option also reporting `auto`, the value was ambiguous between "left untouched" and "picked the Auto option". **After:** `auto` means the user submitted the Auto (best available) region. An untouched field reports whatever default it holds (`general` or `auto`). Production values for untouched submissions don't change, since the removed branch never fired. Fixes [GROWTH-1358](https://linear.app/supabase/issue/GROWTH-1358/studio-regionselectiontype-never-reports-auto-for-untouched-default) ## Solution - `ProjectCreation.utils.ts`: `getRegionSelectionType` classifies only by the submitted region. Removed the `isDbRegionDirty` argument and the untouched-field branch. - `ProjectCreationForm.tsx`: stopped passing `isDbRegionDirty`. The default-region sync effect still uses it, unchanged. - `ProjectCreation.utils.test.ts`: removed the untouched-field cases. The Auto option cases (available and unavailable) stay. - `packages/common/telemetry-constants.ts`: updated the `regionSelectionType` doc to the new meaning. ## Review instructions 1. `pnpm --filter studio exec vitest run components/interfaces/ProjectCreation` passes. 2. On the preview, create a project with the Auto region option and confirm `project_creation_simple_version_submitted` fires with `regionSelectionType: 'auto'`. 3. Create another project leaving a smart group default (e.g. Americas) untouched, or picking an exact region, and confirm it reports `general` or `specific`. ## 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) --- _Generated by [Claude Code](https://claude.ai/code/session_01U4bWS81PTj81V8YkZeFP2Q)_ --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
5bb549efae |
feat(studio): allow setting a password when enabling login on an existing role (#52505)
## What kind of change does this PR introduce? Feature. ## What is the current behavior? Turning on "User can login" for an existing role that couldn't log in gives no way to set a password. Users have to run `alter role ... password` in the SQL editor. ## What is the new behavior? In Database > Roles, turning on "User can login" for a role that couldn't log in now shows the same optional password field as the create panel, including the generate and copy actions. - The field only shows for roles that don't currently have login. Roles that can already log in don't get one. - The password is sent only when login is gained in that save and the field isn't empty. An empty field turns on login without a password, as in create mode. - The password is kept out of the "changed fields" diff, so unrelated edits never send `password ''`. - The password field is extracted from the create panel into a shared `RolePasswordField`, which also owns the "Password generated" announcement state. Follow-up to #52463. Changing the password of a role that can already log in is tracked separately and is the next PR in this stack. <img width="840" height="655" alt="Screenshot 2026-10-29 at 15 47 33" src="https://github.com/user-attachments/assets/8bb52e86-7b1e-4911-b625-2532fb7dfa25" /> ## Testing - New `RoleRow` component tests cover the field's visibility, sending the password, and omitting it when empty or for roles that already have login. - Existing `CreateRolePanel` tests still pass. Part of FE-4763. |
||
|
|
48bc6ef4a5 |
fix: log meter alarm (#52393)
I am updating these meters to make them not so elevated, to reduce customer alarm. I am improving the query info to reduce alarm, and adding a GH discussion link to help route customers to a central location to give feedback for us to consider while improving the product ahead of launch. ## Problem The upcoming meters for ingest and logs work well, but are increasing support ticket volume in a manner that is counter productive to our ability to address the issues, while trying to tend to customer concern and sentiment. ## Solution Addresses customer concern by reducing visibility and adding a GH discussion link to cusotmers can be routed to a cnetral place where we can provide updates and we can collect feedback publicly to address any customer concerns. We still want feedback and to address them, we just need to control the volume. Includes: - removing upcoming pill from both meters - moving the meters lower - adjusting the query text to add more confidence around billing timeline enforcement - added link to the GH discussion to route feedback before: sudio: usage <img width="1284" height="424" alt="image" src="https://github.com/user-attachments/assets/0587f2a9-be6d-4a11-8e33-64b6354bc41d" /> and after: <img width="861" height="448" alt="image" src="https://github.com/user-attachments/assets/708497af-eda9-478f-ad84-f29196f2f01f" /> |
||
|
|
a05e7ec1d7 |
refactor(studio): move self-hosted Assistant tools to contracts (#52468)
Stacked on supabase/supabase#52422. ## What The self-hosted Assistant tools become contracts, so every tool the Assistant can call now comes from the registry and the allowlist is derived from it. * The fallback tools (`getSchemaTables`, `getRlsKnowledge`, `getFunctions`, `getEdgeFunctionKnowledge`) are deleted. Self-hosted now gets the shared tools plus: * `list_tables`: a local contract with the same input as the MCP tool and a similar output, built from pg-meta. It shares its prompt guidance with the remote contract, which moves to `list-tables.remote.ts`. On platform the remote contract is still used. * `list_functions`: self-hosted only, filtered by schema in SQL. * `list_policies`: now available in both environments. * `runPgMetaQuery` (`tool-sql.server.ts`) runs pg-meta-built SQL and validates the rows with the builder's zod schema. Off platform it calls `executeQuery` directly, because the default fetcher goes through a relative API URL that doesn't resolve server-side. * The allowlist comes from the registry: * `ToolName` and the tool set validation schema are built from the contract keys. The tool category map is removed. * `mcp-tools.ts` keeps only tools with a remote contract, before opt-in filtering, so `UI_EXECUTED_TOOLS` is gone. `EXPECTED_MCP_TOOLS` is derived from the contracts and type-checked against the MCP package. * Saved chats: the legacy contracts now trim replayed outputs. `getRlsKnowledge` replays only the saved policy list, without the stale RLS instructions. `getEdgeFunctionKnowledge` replays a pointer to `load_knowledge`. * The logs reference text no longer names `query_logs`. ## Behavior changes * `list_policies` on platform validates rows before formatting, so a row that fails pg-meta's schema now errors the tool call instead of returning text. * `list_tables` on self-hosted doesn't include the MCP tool's optional `advisory` field. * `list_functions` with an empty `schemas` list returns every non-system schema. * On platform, if the MCP tools fail to load, `list_tables` is dropped from the tool set like the other remote tools. ## Tests * Unit tests for `runPgMetaQuery`, the local `list_tables` and `list_functions`, and the output mapping. The SQL boundary is mocked; not yet run against a live self-hosted database. * Legacy contract tests cover trimming, the empty and missing policy cases, and that replaying an already-trimmed output leaves it unchanged. ## 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>) |
||
|
|
7837277084 |
fix(studio): correct grammar in organization not found message (#52276)
## Problem The Studio error shown when an organization does not exist, or the user lacks permission to view it, has two grammar mistakes: "permission to access to it" and "Contact the the owner". ## Solution Changed the copy to "permission to access it" and "Contact the owner". This is a text-only change in `OrgNotFound.tsx`, reformatted with the repo's Prettier config. No logic changed. ## Review instructions 1. Open `/dashboard/org/<a-slug-that-does-not-exist>` on the Studio preview. 2. Confirm the message reads: "This organization does not exist or you do not have permission to access it. Contact the owner if you believe this is a mistake." ## 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, no docs changed) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
6aefa45d2b |
refactor(studio): build the Assistant tool prompt from contracts (#52422)
Stacked on supabase/supabase#52398. ## What The chat system prompt's tool guidance now comes from the contracts available to the request, so the prompt never names a tool the request doesn't have. * `ToolContract` and `RemoteToolContract` gain an optional `promptGuidance`: rules for using the tool that its description doesn't cover. * `buildToolsPrompt` generates a `## Tools` section: every available tool by name, sorted, plus a section with the guidance of each tool that has any. Tool descriptions aren't repeated, since the model already gets them in the tool definitions. * `getToolRequest` computes the environment and satisfied requirements once, for both `getTools` and the prompt. * `buildSystemPrompt` assembles the full chat system prompt, used by `generateAssistantResponse` and by the tests. * Rules that named a tool move out of `GENERAL_PROMPT`, `CHAT_PROMPT`, `LIMITATIONS_PROMPT`, `NOTEBOOKS_PROMPT` (deleted), the hardcoded Available Knowledge list, and the opt-in, support-mode, and logs-snippet context messages into the `promptGuidance` of the tool each rule is about. * `SECURITY_PROMPT` is unchanged because it's shared with code completion. ## Prompt changes * Platform: the same guidance, reorganized under the tool it applies to. Small rewording: the two `search_docs` rules are merged, the opt-in rule no longer starts with "if `update_opt_in_level` is available", and two typos are fixed. The tool list also names tools the old prompt didn't mention. * Self-hosted: the prompt lists only `execute_sql`, `load_knowledge`, and `rename_chat`, and no longer mentions platform-only tools like `search_docs`, `query_logs`, notebooks, or the opt-in tool. The self-hosted fallback tools aren't listed until they become contracts in a later PR. ## Prompt caching The tools section varies with the actual provided tools. That adds no cache misses: providers cache tool definitions before the system prompt, so a change to the tool set already invalidates the cached system prompt ([Anthropic](<https://platform.claude.com/docs/en/build-with-claude/prompt-caching#what-invalidates-the-cache>), [Bedrock](<https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-caching.html#prompt-caching-converse>), [OpenAI](<https://developers.openai.com/api/docs/guides/prompt-caching>)). ## Tests * For every combination of environment, Explorer, support mode, and base URL, the system prompt and context messages name only tools available to that request. * Outside its generated section, the system prompt names no tools except `execute_sql` in the shared `SECURITY_PROMPT`. * Labeled `run-evals` to check the reworded prompt for regressions. ## 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>) |
||
|
|
552312507f |
fix(studio): storage policy footer (#52531)
## Problem Footer is hidden when reviewing a policy for storage. ## Solution The footer is now fixed and sticks so that the user can see the buttons at all times: <img width="1152" height="712" alt="Screenshot 2026-10-29 at 20 07 32" src="https://github.com/user-attachments/assets/87e97afd-fb33-4e63-a67d-fb9861449a20" /> Closes #52520 ## 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) |
||
|
|
1915615dca |
fix: clamp Popover/Select/DropdownMenu content to viewport height (#49233)
## 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? Bug fix. ## What is the current behavior? Fixes #49155. The three dropdowns in the issue (Edge Function Logs Severity filter, and the two dropdowns in the "Add foreign key relationship" modal) all get clipped by the viewport with no way to scroll to the rest of the content, in some cases making buttons unreachable. All three share the same root cause: `PopoverContent`, `SelectContent`, and `DropdownMenuContent` in `packages/ui/src/components/shadcn/ui/` each cap their max height with either a hardcoded pixel value (`max-h-96`, `max-h-[300px]`) or nothing at all, instead of using the available-height CSS variable Radix's Popper already computes and exposes for exactly this purpose. When the real available space is smaller than the hardcoded cap, the content still renders at the larger size and overflows past the edge of the screen. ## What is the new behavior? Swapped the fixed `max-h-*` values for the matching `--radix-*-content-available-height` variable on all three components, and changed `overflow-hidden` to `overflow-y-auto` so any content that still doesn't fully fit gets an internal scrollbar instead of clipping off-screen. ## Additional context **On verification:** I wasn't able to get an actual visual click-through of this fix. Locally, `apps/design-system` (the component demo site) hits a known contentlayer2 issue on Windows that leaves every `/docs/*` page 404ing regardless of this change. The CI preview deployment for `design-system` did build successfully, but it's gated behind Vercel SSO (team-only), which I don't have access to as an external contributor. What I did verify directly: - `pnpm --filter=ui typecheck` passes clean. - The three CSS variable names I'm referencing (`--radix-select-content-available-height`, `--radix-popover-content-available-height`, `--radix-dropdown-menu-content-available-height`) are real — confirmed by reading the installed `@radix-ui/react-select`, `@radix-ui/react-popover`, and `@radix-ui/react-dropdown-menu` source directly, where each one aliases its own variable to the underlying `--radix-popper-available-height` that Popper computes. - Compiled the exact new classes through this repo's pinned Tailwind version (4.2.4) via `@tailwindcss/postcss` directly, and confirmed each one generates the expected rule, e.g. `.max-h-\(--radix-popover-content-available-height\) { max-height: var(--radix-popover-content-available-height); }` — so there's no syntax mistake in the arbitrary-value class. Happy to have someone with repo access check the design-system preview, or I can revisit this once I have another way to view it. There's also a fourth spot in the report — the Severity filter's option list (`packages/ui-patterns/src/FilterBar/DefaultCommandList.tsx`), which hardcodes its own `max-h-[300px]` on an inner div rather than the `PopoverContent` primitive directly. That div renders inside the now-fixed `PopoverContent`, so it may already be covered by this change since CSS custom properties inherit to descendants — but since I couldn't confirm that visually either, I've left it untouched for now rather than guess. --------- Co-authored-by: Drew McLellan <drew.mclellan@gmail.com> |
||
|
|
189ade6bc3 |
fix(reports): use minute buckets for short ranges DEBUG-95 (#52145)
## Problem The last 60 minutes in Shared API Report collapses requests, errors, response speed, and network traffic into hourly points. This affects the Data API, Auth, and Realtime reports using ClickHouse. ## Fix Choose minute buckets for short ClickHouse report ranges and retain hourly buckets for longer ranges. Existing preset consumers keep their hourly defaults, and route summaries retain their current behavior. ## How to test - Open Observability → Data API and select Last 60 minutes. With requests across the hour, the charts should show minute-level data. - Switch to Last 24 hours and confirm the charts retain hourly grouping. - Apply a report filter and confirm the charts and route summaries respect it. - Repeat the short-range check on Auth or Realtime. Validation: 80 focused report tests passed with retries disabled and shuffled order. The ClickHouse boundary tests failed when the 60-minute cutoff was deliberately broken, then passed after restoring the fix. Studio typecheck and changed-file formatting passed. Independent review found no issues. The ClickHouse behavior was verified in the preview: minute buckets for Last 60 minutes on Data API and Auth, hourly buckets for Last 24 hours, and route filtering on charts and summaries. Fixes https://linear.app/supabase/issue/DEBUG-95 |
||
|
|
65217161af |
fix(studio): prevent ghost redirects on unmounted SignInPartner (#46594)
## 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? Bug fix ## What is the current behavior? Please link any relevant issues here: Resolves **#46593** There is a navigation race condition in `apps/studio/components/interfaces/SignIn/SignInPartner.tsx`. On mount, an IIFE fetches `auth.getSession()` and potentially `auth.signInWithIdToken()`. If the user navigates away from the page (unmounting the component) while these network promises are still pending, the `finally` or `else` blocks will still execute `router.replace()`. This forces an unintended "ghost redirect" that hijacks the user's active session and pulls them away from their current page. ## What is the new behavior? This PR introduces a standard `isMounted` flag to guard the asynchronous operations inside the `useEffect` hook. * A cleanup function now correctly flips the `isMounted` flag to `false` when the component unmounts. * An early exit `if (!isMounted) return` prevents unnecessary execution if the component is destroyed during the initial session fetch. * The `router.replace()` calls are now wrapped in `if (isMounted)` checks, ensuring that redirects only trigger if the component is still active in the DOM. ## Additional context This is an isolated frontend lifecycle patch. Local pre-flight checks (`pnpm typecheck`, `pnpm lint --filter=studio`, and `pnpm test:studio`) have all passed successfully. --------- Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com> |
||
|
|
e79adc4a42 |
docs: move leaked API key rotation to its own page (#52465)
Closes DOCS-1493 ## Problem The Rotate a leaked or compromised key section of API keys is split out as a part of the Information Architecture plan laid out in Option 1 of the [Docs navigation architecture proposal](https://app.notion.com/p/supabase/Q4-2027-Proposal-Docs-navigation-architecture-3f25004b775f81f49dbad710a732ef61). ## Solution - **Structure:** move `### Rotate a leaked or compromised key` to `guides/security/rotate-leaked-api-keys`. API keys keeps the heading and its `#leaked-key` id, with a one-sentence pointer. The page is in the Security sidebar under Guides, since its URL selects that sidebar. - **Option 1 navigation:** the "Rotate a leaked API key" entry in Run and manage, Security and compliance, points to the new page. The Option 1 test no longer expects the anchor. Run /test-the-docs and /edit-the-docs. ## Manual testing 1. Open [Rotate a leaked or compromised API key](https://docs-git-docs-rotate-leaked-api-keys-supabase.vercel.app/docs/guides/security/rotate-leaked-api-keys). See the create, replace, and retire sections, with Dashboard and Management API tabs. 2. Open [API keys](https://docs-git-docs-rotate-leaked-api-keys-supabase.vercel.app/docs/guides/getting-started/api-keys#leaked-key). See the heading with a one-sentence pointer to the new page. 3. In the Security sidebar under Guides, click **Rotate a leaked or compromised API key**. See the new page open. |
||
|
|
3d76559cec |
chore(studio): remove logs.all deprecation banner (#52491)
## Problem The `logs.all` Management API endpoint retired on September 23, and the deprecation banner stopped rendering on September 24 because of its hardcoded expiry. The banner's code is now dead weight in the bundle. Resolves GROWTH-1104. ## Solution Removes the banner and everything it pulled in: - Deletes `BannerLogsAllDeprecation.tsx`, plus its mount effect, expiry timer, and exposure tracking in `AppBannerWrapper.tsx`. - Removes `isLogsOrObservabilityPath` (only this banner used it) and its tests. - Removes `BANNER_ID.LOGS_ALL_DEPRECATION`. `BannerStackProvider.test.tsx` used it as an arbitrary ID, so those tests now use `BANNER_ID.EXPLORER`. The tests themselves are unchanged. - Removes the `LOGS_ALL_DEPRECATION_2026_09_23` local storage key and the two `logs_all_deprecation_banner_*` telemetry events. The dismissal key stays in users' browsers, which is harmless because nothing reads it anymore. ## Review instructions 1. Open a project's Logs or Observability page on the preview and confirm no `logs.all` notice appears and the page renders normally. 2. Open an organization's landing page and confirm the Terms of Service banner still behaves as before. ## 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) |
||
|
|
0bd4b8db48 |
fix(studio): remove search and sorting from webhook deliveries table (#52499)
## Problem The webhook deliveries table has a search input and sortable column headers, but they only act on the page of rows already loaded (5 rows). The backend uses cursor pagination and has no server-side filtering or sorting, so searching for a term that isn't on the visible page shows "No deliveries found" even when matches exist. This looks broken. Closes FE-4762. The follow-up to bring these back once the backend supports it is tracked in DEPR-709. ## Solution - Removed the search input, its focus shortcut, and the `deliverySearch` URL state from the deliveries table. - Removed the sort controls from the column headers. Headers are now plain text. - Removed the unused `filterWebhookDeliveries` helper and its test. Rows now render in the order the API returns them. - Updated the empty state copy, since it referred to adjusting a search. - Cursor pagination is unchanged. ## How to test 1. Open a project's webhooks page and select an endpoint with deliveries. 2. Check that the Deliveries section has no search input, only the Live toggle and the refresh button. 3. Check that the column headers (Status, Event, Response, Attempted) are not clickable and show no sort icons. 4. Check that the previous and next page buttons still page through deliveries. 5. Select an endpoint with no deliveries and check that the empty state reads "Webhook attempts will show up here once this endpoint receives events." |
||
|
|
7867f22522 |
feat(studio): link log users and show Auth activity timelines (#50837)
Add a User tab that resolves the signed-in user from the selected log or a related request step. It shows the shared Auth profile, offers filtering from the User ID row, and explains anonymous, external, or deleted users. When unified logs are enabled, the Auth user's Logs tab shows the user's 10 most recent logs in `EmbeddedLogsTable`, with the Logs page's columns and row styling. A row opens that log on the Logs page, filtered to the user, and View more in Logs opens the rest. Other configurations retain the existing Logs view. Shared user presentation is isolated in #50841; this PR contains the log/Auth integration and resolves missing-user queries to null. The list uses the #50953 helpers instead of its own: `createUnifiedLogsSearch` builds the query search, `buildUnifiedLogsUrl` builds the links (it now takes a `logId` to open a log), and the query asks for only the 10 rows it shows via `pageSize`. At the panel's default width the table is wider than the panel, so Event message needs a horizontal scroll; the empty state renders outside the table so it stays in view. Issue: [DEBUG-222](https://linear.app/supabase/issue/DEBUG-222/build-correlated-log-and-user-connections-in-studio) ### How to test 1. With the Unified Logs preview and `otelUnifiedLogs` enabled, open a signed-in user's log and select User. Check the profile, copy the User ID, and use Add filter to filter logs to that user. 2. Use Open in Authentication, then open the user's Logs tab. Select a row and confirm it opens the matching log; check that View more in Logs preserves the user filter. 3. Open an anonymous request and confirm the explanatory state. For correlated, external, and deleted-user cases, run the fixtures: `pnpm --filter studio exec vitest run components/interfaces/UnifiedLogs/components/LogUser.platform.test.tsx`. 4. In the log's User tab, focus User ID and press Enter, Arrow Down, Enter. Confirm it copies the ID without changing the selected log. Arrow Down should navigate logs again after the menu closes. ### Validation - Latest head: `8e4a9993b0db52ec5e611e55233b5ed77f67e358`, based on `master`, with conflicts resolved and independent review complete. - Local baseline and shuffled verification passed 324 tests across 26 files with retries disabled (shuffle seed `5083710`). An independent affected-suite run passed 29 tests with retries disabled and shuffle seed `5083730`. - Live QA found and reproduced a keyboard collision: field-menu Arrow Down also selected the next log. The shared menu now keeps keyboard events inside the menu. The regression fails when the guard is removed and passes after restoration. - On the verified latest-head preview, keyboard User ID copy, mouse copy, Add filter, Escape, navigation after closing the menu, and adjacent Auth email copying passed. No browser console errors were observed; browser network telemetry was unavailable. - Full signed-in activity, matching log/profile, Authentication navigation, View more filtering, anonymous state and deleted-user handling passed on `311206f9ef`. The subsequent change only affects menu keyboard propagation, which was revalidated on the latest head. - The disposable staging user was deleted and absence verified. Temporary key files were removed and the clipboard cleared. - Current CI: all E2E suites, unit tests, formatting, lint, Docker and deployments passed; typecheck is still running. Local full typecheck exhausted Node's heap, so no local full pass is claimed. ### Stack All prerequisite log-decoupling and request-correlation PRs, including #50841, are merged into `master`. This is the final code PR in the stack. --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Jordi Enric <jordi.err@gmail.com> |
||
|
|
26a88e792d |
chore(studio): bump @supabase/mcp-server-supabase to 0.15.0 (#52454)
## Summary - Bump `@supabase/mcp-server-supabase` from `^0.12.0` to `^0.15.0`. - Add `submit_feedback` / `delete_feedback` to self-hosted `/api/mcp` via upstream `createFeedbackOperations`, without the self-hosted project ref. Notebook tools stay out of self-hosted. ## Verification Against the pkg.pr.new preview: `tsc --noEmit` in `apps/studio` passes, MCP vitest suites pass (14/14), and `tools/list` on `/api/mcp` includes the feedback tools and no notebook tools. Closes: [AI-1369](https://linear.app/supabase/issue/AI-1369/2b-update-self-hosted-remote-mcp-server-self-hosted-studio-assistant) --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
bd62dec2e2 |
refactor(studio): share Auth user cards and detail fields (#50841)
Extract shared Auth user cards and copyable detail fields, and use the shared raw-JSON display in the user panel. The existing Logs view remains available; unified activity timelines and log-user filtering arrive separately in #50837. This includes display-name/initials coverage and the Auth panel's component and browser tests. The browser test now verifies keyboard copying and Escape panel dismissal separately: the existing Auth Escape shortcut closes the details panel, so expecting it to restore focus to a field was incorrect. Its Raw JSON check reads the copied JSON's fields, since the code view's text includes line numbers. `UserCard` is Studio's first `Avatar`, so `vite.config.ts` pins `avatar.tsx` to its own chunk, like `field`, `drawer` and `slider`. Otherwise Rolldown pools it into the Auth `users` page chunk that the `ui` barrel then imports back, a chunk cycle that fails the TanStack build. ### How to test 1. Open an existing user in Authentication → Users. Check the profile card, overview fields, and name/avatar fallbacks for a user without profile metadata. 2. Open a copyable field using both mouse and keyboard (Enter), choose Copy, and check the clipboard value. 3. Open Raw JSON, scroll, and use the floating copy button. Confirm the existing Logs tab still opens and Escape closes the user panel. ### Validation - Final head `f4f8cb22e97fefac56c68b4676184d8358d8080e` targets master without conflicts. - Focused local tests: 13 passed across three files, retries disabled, including independent shuffled seed 5084131. Real panel/MSW tests cover field copying and complete nested JSON; fallback and Unicode regressions detect the original broken behavior. - Browser QA passed on `6b49434339`: nameless profile fallback, overview fields, mouse/keyboard copying, Raw JSON scrolling/copying, existing Logs tab, and Escape dismissal. Later commits change only the E2E test; application code is identical. - All GitHub checks passed on the final head, including four unit-test shards, four Next/TanStack E2E shards, typecheck, formatting, lint ratchet, knip, and Studio Docker build. - Independent review found no remaining issues; all review threads are resolved. - Fresh final-head studio-staging preview is blocked during dependency installation: the registry returns HTTP 451 for `react-hook-form@7.72.1`. The earlier matching application preview passed browser QA; this deployment failure remains visible. ### Stack Based on the logs table building blocks stack, which merges first: #50953 → #50954 → #50955 → #50957 → #50958 → #52281. Then merge in order: 1. #50835 — grouped log overviews and raw JSON 2. #50840 — request correlation queries 3. #50836 — request timeline UI and folding 4. #50841 — shared Auth user details 5. #50837 — log user correlation and Auth activity --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Jordi Enric <jordi.err@gmail.com> |
||
|
|
6aed258d87 | feat(migration): Move pipeline_id to string (#52489) | ||
|
|
c777ca1c74 |
fix(studio): quote pgmq.create_partitioned interval args as text to f… (#52480)
## Problem Creating a **partitioned queue** from the dashboard (Integrations → Queues → Create queue) fails with: ``` Failed to create database queue: function pgmq.create_partitioned(unknown, integer, integer) does not exist ``` The form submits `partitionInterval` / `retentionInterval` as numbers, and `literal()` in pg-format renders numbers unquoted, so the generated SQL passes bare integers while `pgmq.create_partitioned` declares these parameters as `text`. Fixes #52479 ## Solution Convert the intervals with `String()` before passing them to `literal()` so quoted text literals are generated, matching the function signature: ```sql select from pgmq.create_partitioned('my_queue', '10000', '100000'); ``` When both intervals are unset, the arguments are omitted entirely so the function defaults (`'10000'` / `'100000'`) apply instead of explicit `NULL`s. Basic and unlogged queue creation are untouched. ## Review instructions 1. Enable the Queues integration on a project running pgmq whose `create_partitioned` takes text args (e.g. self-hosted / pgmq 1.5.x) 2. Go to Integrations → Queues → Create queue 3. Select "Partitioned queue" (default) and click Create queue 4. Verify the queue appears in the list, and `select * from pgmq.list_queues()` reports `is_partitioned = true` ## 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: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com> Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com> Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
|
|
e8765574ef |
fix(studio): execute next/script scripts in the TanStack build (#52497)
In the TanStack build, `next/script` is a compat shim that rendered a
plain React `<script>` element. React never executes scripts it creates
on the client, so `<Script>` silently did nothing. The only consumer is
`TelemetryTagManager` (`packages/common/telemetry.tsx`), so Google Tag
Manager never loaded on the dashboard: the tag was in the DOM, but no
`gtm.js` event and no loader request.
**Changed:**
- `compat/next/script.tsx` is now a client-only port of Next's
`next/script`: it renders nothing and injects the script imperatively in
an effect (`document.createElement`), with Next's attribute handling,
`onLoad`/`onReady`/`onError` semantics and `lazyOnload` strategy
- Scripts are deduped by `id`/`src` at module level, so remounts and
duplicate instances never execute the same script twice (GTM can't
double-initialize)
- `beforeInteractive` and `worker` load after mount like
`afterInteractive`, since there's no Next document or Partytown in the
SPA
**Added:**
- `compat/next/script.test.tsx` covering inline execution, dedupe across
remounts, `src` scripts, load/error callbacks and `lazyOnload`
No CSP change needed: `script-src` already allows `'unsafe-inline'` and
the Stape GTM host, and `connect-src`/`img-src`/`frame-src` cover its
collect hits and service-worker iframe.
## To test
- On the preview, with consent accepted, open devtools on any dashboard
page:
- `window.dataLayer` contains a `gtm.js` event and
`window.google_tag_manager` is defined
- The Network tab shows the GTM loader request (`4icgbaujh.js`) plus
collect hits
- Exactly one `script[src*="4icgbaujh"]` element exists, even after
navigating around
- No CSP violations ("Refused to load…") in the console, including on
sign-in/sign-up
- Opt out of analytics in Account → Preferences, reload, and confirm the
loader isn't requested
---------
Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
|
||
|
|
8bdc2bf0c5 |
feat(studio): refresh webhook deliveries on demand instead of polling (#52444)
## Problem The deliveries table polled the API every 5 seconds, for as long as the page was open. Studio tables are not polled by default, and polling is only needed here because delivery results arrive asynchronously. Stacked on #52314. Linear: [FE-3750](https://linear.app/supabase/issue/FE-3750/add-pagination-to-platform-webhooks-deliveries-table) ## Solution - Deliveries are no longer polled by default. - A **Live** button turns polling on (every 5 seconds), and a **Refresh** button reloads once. - Polling also turns on by itself while a delivery is pending, and after a test event or retry is sent until its delivery appears (30 seconds at most). The action never looks like it did nothing. - Hovering a failed delivery explains that failed deliveries are usually retried automatically. The API returns no retry state yet, so a scheduled retry only shows up once its attempt starts. ## Review instructions 1. Enable the Platform Webhooks feature preview, open an endpoint with deliveries, and filter DevTools > Network by `deliveries`. No request repeats on its own. 2. Click Refresh. One request is sent. 3. Click Live. A request is sent every 5 seconds and the dot pulses. Click Live again and the requests stop. 4. Send a test event. Requests repeat for a few seconds until the new row appears, then stop. 5. Set the endpoint URL to `https://httpbin.org/delay/10` and send a test event. While the new row shows `pending`, requests repeat. Once it shows `success`, they stop. 6. Hover a `failure` badge. The retry tooltip shows. |