Commit Graph
6129 Commits
Author SHA1 Message Date
Steven Eubank 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"
/>
2026-11-02 17:41:08 +08:00
Charis 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>)
2026-10-31 07:44:36 -04:00
Nayan KumarandClaude Opus 5.5 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>
2026-10-30 22:05:50 -06:00
hallidayo 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)
2026-10-30 07:01:17 -06:00
Ganesh kumar TandDrew McLellan 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>
2026-10-30 09:32:10 +00:00
Jordi Enric 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
2026-10-30 10:00:46 +01:00
SainavaandAlaister Young 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>
2026-10-30 14:16:39 +08:00
Miranda Limonczenko 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.
2026-10-29 21:35:44 +00:00
Mert YEREKAPAN 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)
2026-10-29 14:44:04 -06:00
Monica Khoury 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."
2026-10-29 17:33:45 +02:00
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>
2026-10-29 16:15:21 +01:00
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>
2026-10-29 15:22:12 +01:00
Riccardo Busetti 6aed258d87 feat(migration): Move pipeline_id to string (#52489) 2026-10-29 15:16:51 +01:00
Monica Khoury 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.
2026-10-29 12:44:44 +02:00
Coenen Benjamin 253d874e38 fix(warehouse): disallow warehouse installation on orioledb (#51913) 2026-10-29 11:31:54 +01:00
Drew McLellan 9b015c7427 feat(studio): allow setting a password when creating a role (#52463)
## Problem

The Create Role panel offers "User can login" but no way to set a
password, so a role created with login enabled can't authenticate with a
password until one is set elsewhere. The role SQL builder in `pg-meta`
already supports a password on create; the form just never sent one.

Resolves FE-4763.

## Solution

- Add an optional **Password** field to the Create Role panel, shown
only while "User can login" is on. It has a copy button and a "Generate
a password" action, matching how project creation handles database
passwords.
- Keep password optional. If the field is empty, or login is turned off
after typing one, the password is left out of the request, so behavior
is unchanged from today.
- Link the privilege switch labels to their switches (the label
previously pointed at a wrapper `div`), which also lets the new tests
find the switch by its label.
- Tests: a `pg-meta` case creating a role with a password containing
quotes, and component tests asserting the SQL sent for each of the four
password and login combinations.

Not in scope: editing or resetting an existing role's password. 

<img width="663" height="661" alt="Screenshot 2026-10-28 at 17 22 59"
src="https://github.com/user-attachments/assets/270fcfb4-4dc9-4dc1-b8e6-4141ee755ac2"
/>


## Review instructions

1. Open Database > Roles and click **Create role**.
2. Confirm no password field shows until you enable **User can login**.
3. Enable login, click **Generate a password**, then copy it with the
copy button, and create the role.
4. Confirm you can connect as the new role using that password.
5. Create another role with login enabled and the password left empty;
confirm it is created as before.
6. Click a switch label (for example "User can login") and confirm it
toggles the switch.

## 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)
2026-10-28 21:49:07 +00:00
Charis 19aa27384a feat(studio): guard branch creation with FGA grants (#52375)
Part 4 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 create mutation takes a grant. `CreateBranchButton`,
`CreateBranchModal`, and `Branch.Commands` (legacy `CREATE
preview_branches`) switch to `useGrant('POST
/v1/projects/{ref}/branches')`. "Include data" is disabled without
production create; previously it failed after you submitted. The GitHub
integration form gets a minimal production-create guard, which ##52377
replaces.

## Testing
New `CreateBranchButton` test.
2026-10-28 14:16:03 -04:00
4f75659942 feat(studio): show request timelines with ordered active log folding (#50836)
Add a Timeline tab that displays related request logs and opens a
selected step in the overview. The panel summary, timestamp, and
navigation controls follow the active log.

Long timelines show the first three steps and retain the active log in
its chronological position. Separate controls count hidden rows before
and after it, for example `+3 more`, the active log, then `+2 more`.
Expanding either control restores the full order. Query construction and
fetching are reviewed separately in #50840.

### How to test

1. With `otelUnifiedLogs` enabled, open a non-compute log with related
request activity and select Timeline. Check chronological order, then
select a step and confirm its overview and panel summary update.
2. Expand a long timeline, select a later step, and return to Timeline.
The active step should stay in order, with separate hidden counts above
and below. For nine steps with the seventh active, expect `+3 more`, the
active step, then `+2 more` after the first three steps. Expand using
both mouse and Enter.
3. If a long request is unavailable, run the deterministic
folding/navigation cases: `pnpm --filter studio exec vitest run
components/interfaces/UnifiedLogs/components/RequestTimeline.platform.test.tsx
components/interfaces/UnifiedLogs/components/LogTimeline.utils.test.ts`.

### Validation

- Focused local unit/MSW suite: 260 tests passed across 18 files with
`--retry=0 --sequence.shuffle --sequence.seed=5083605`.
- Browser QA verified a real five-step request timeline and folding.
Nine-step folding and active-log ordering were verified with
deterministic fixtures.
- All checks triggered on head `6b80811bae` passed.
- Master-only typecheck, unit, formatting, and lint workflows do not run
against this stack base. Rerun them when the PR is retargeted to
`master`.

### 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>
2026-10-28 17:14:53 +01:00
supabase-vercel-tedd[bot] 91b780c7d7 feat(studio): layout-shaped loading state for compute instance detail (#52453)
Replaces the three generic shimmer bars on the Compute instance detail
page with a placeholder that follows the loaded layout.

**Why**

While the instance loads, the page showed three full-width bars with no
header, tabs or sections. When the data arrived, the whole page jumped
into a different shape.

**Approach**

A new `ComputeInstanceDetailSkeleton` reuses the same page primitives as
the loaded view (`PageBreadcrumbs`, `PageHeader`, `PageNav`,
`PageContainer`, `PageSection`) and the existing `ShimmeringLoader`, so
widths, padding and breakpoints match the real page:

- Breadcrumbs: the static Compute link, with a placeholder for the
instance name
- Header: a 56px icon placeholder, a title placeholder and three
metadata placeholders (state, runtime, version)
- Tabs: four placeholders sized like the tab labels
- Overview: the static Instances, Container and Resources section
headings, the ready-count line, the 2/4-column instance count grid, and
the container and resource rows

No instance values are shown until the data loads. On a non-overview tab
(`?tab=logs`, etc.), the content area falls back to the same
`GenericSkeletonLoader` the logs tab already uses. Data fetching, error
handling, the "instance does not exist" state and the loaded view are
unchanged.

**Validation**

- New `ComputeInstanceDetail.platform.test.tsx`: holds the instance
request open, checks that the placeholder renders (section headings,
breadcrumb link, no instance name, no tabs, no row labels), then
releases it and checks that the header, tabs, instance counts and
container rows render and the placeholder is gone. The existing Compute
tests still pass.
- `eslint` on the changed files: clean. `pnpm --filter studio lint`: 0
errors.
- `pnpm --filter studio typecheck` (`tsc --noEmit`) ran out of memory in
the sandbox (exit 137) twice, so it was not run to completion.

Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com>
2026-10-28 15:56:23 +01:00
Charis ce52277546 feat(studio): migrate branches list query to FGA grants (#52373)
Part 2 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
`useBranchesQuery` becomes `branchesQueryOptions`, which takes a grant,
uses `skipToken` without one, and keeps the grant out of the query key.
Every call site moves to `useGrant('GET /v1/projects/{ref}/branches')`.
Places that use the list incidentally (nav, project home, usage,
settings, GitHub status) treat a denied grant as "no branches" instead
of loading forever. Config drift no longer stays pending when its
prerequisites fail. Page gating is unchanged here and moves in the next
PR.

## Testing
Usage, General, `useGitHubConfigDrift`, and ConfigurationDriftPage
tests.
2026-10-28 09:45:43 -04:00
6612073428 feat(studio): add bounded request correlation queries (#50840)
Add tested query support for correlating logs by request and execution
IDs across API Gateway, Auth, Storage, and Edge Functions. Queries are
source-scoped, time-bounded, and limited to 200 rows, with at most one
additional lookup to follow a newly discovered execution ID.

This data-only layer introduces no UI or automatic requests. The
Timeline tab consumes its query options in #50836. Overview and request
correlation share a cached source-and-attributes lookup, including
concurrent requests. Cancelling a timeline preserves any shared overview
lookup. The new query is exercised through MSW without mocking React
Query hooks.

### How to test

This is a data-only PR. From the repository root, run:

```sh
pnpm --filter studio exec vitest run components/interfaces/UnifiedLogs/UnifiedLogs.queries.test.ts data/logs/unified-log-request-timeline-query.test.ts
```

The tests exercise source-scoped IDs, SQL escaping, time/row limits,
missing IDs, failed requests, the additional execution-ID lookup,
attribute-cache reuse in both navigation orders and concurrently, and
cancellation through MSW.

### Validation

- Synced with master; verified head
`a60bcf0565e0e3477779665660e871eec2edd2c8`.
- Focused unit/MSW baseline and shuffled seed 5084028: 121 tests across
seven files passed with retries disabled. Independent shuffled run, seed
5084029: 117 tests across six files passed.
- Correlation, shared lookup/cache, cancellation, and the 400-second
function boundary are covered. Behavioral mutation checks detect
shared-lookup cancellation and a shortened execution window.
- Matching studio-staging preview smoke check passed for existing
grouped overview attributes and complete copied Raw JSON metadata.
- All four unit-test shards, all four E2E shards, typecheck, formatting,
lint ratchet, knip, and Studio Docker build passed on this head.
- Independent review found no actionable issues; no unresolved review
threads.

### 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>
2026-10-28 14:41:49 +01:00
Charis 6a27ccbe09 fix(studio): restore RLS permission checks for GitHub/Vercel integrations (#52385)
## Problem
Project-scoped admins see "You need additional permissions to view
GitHub connections" (and the same for Vercel) since #50966. That PR
moved these checks to `ORGANIZATION.CONFIG_READ`/`CONFIG_WRITE`, which
the v2 permissions API never grants to project-scoped members.

## Fix
The platform endpoints behind these views don't use OpenFGA:
- GitHub connections: list/update/delete are RLS-only; create uses
`canForProjectRef(READ, 'projects')`
- Vercel connections: create uses `canForProjectRef(CREATE,
'integrations.vercel_connections')`; the rest are RLS-only
- OAuth apps (installed integrations view):
`AuthWithOrganizationSlug(READ, 'oauth_apps')`

So this reverts #50966's changes in `GithubSection`,
`GitHubIntegrationConnectionForm`, `VercelSection`, `Landing.utils` and
`useInstalledIntegrations` back to `useAsyncCheckPermissions` with the
original resources, and updates
`MarketplaceIntegrationSettingsTab.test.tsx` to mock the v1 permissions
endpoint.

## Testing
- `MarketplaceIntegrationSettingsTab.test.tsx` and
`MarketplaceDetail.test.tsx` pass

Fixes FE-4751
2026-10-28 09:08:24 -04:00
671594c69c feat(studio): group log overviews and standardize raw JSON (#50835)
Logs without a service-specific overview now show common fields and
attributes in collapsible groups. Existing service overviews use the
same section layout, with the first section open. Configured fields
share one renderer across service overviews. Raw JSON uses shared
presentation for single-log, multi-log, and downstream Auth views, with
copy controls supplied by each view.

Attribute lookups are scoped to the selected log's source, ID, and
timestamp window and respect metadata visibility. It's based on the
#50953 stack; request correlation, timeline UI, and Auth changes are
separate layers. Sections use the `CollapsibleDetailSection` that master
now shares with the audit log pages, and the new Supavisor overview
follows the same layout: no separate time header, first section open.

### How to test

1. With Unified Logs and `otelUnifiedLogs` enabled, open an API Gateway
log and a Postgres or Auth log. Check the overview sections,
expand/collapse groups, and try copying a field.
2. Open Raw JSON on a log with enough metadata to scroll. Confirm the
copy button stays visible and copies the complete JSON.
3. Select multiple logs and confirm their combined JSON still renders
correctly.

### Validation

- Synced with master; verified head
`663ebfd13117ae3c5aa0de52e4488253a317d59f`.
- Focused local unit/MSW suite: 246 tests passed across 19 files with
retries disabled, both normally and with `--sequence.shuffle
--sequence.seed=50835`. Independent focused run: 24 tests passed with
seed 5083528.
- Browser QA on the matching studio-staging preview passed: API Gateway
and Postgres section expansion/collapse, field copying, scrolling and
copying complete Raw JSON, and copying multiple selected logs.
- All four unit-test shards, all four E2E shards, typecheck, formatting,
lint ratchet, and Studio Docker build passed. The Next.js E2E report
includes one storage-folder test that passed on retry.
- Independent code review found no actionable issues. Working tree
clean.

### 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>
2026-10-28 14:07:04 +01:00
Monica Khoury d973267d27 feat(studio): paginate platform webhooks deliveries table by cursor (#52314)
## Problem

The deliveries table loaded one page from the API and split it into
pages of 5 in the browser, so older deliveries could not be reached.

Linear:
[FE-3750](https://linear.app/supabase/issue/FE-3750/add-pagination-to-platform-webhooks-deliveries-table)

## Solution

- **Cursor pagination:** the table requests deliveries 5 at a time
(`page[after]`), and Next and Previous load the next or previous page.
It asks for 6 and shows 5, so Next is never enabled on an empty page.
Previous uses the history of cursors we visited, because the API's
`prev` link can skip a row or land on an empty page.
- The footer reads "Showing N deliveries" (the API returns no total).
The delivery search still filters only the loaded page.
- **Loading and errors:** skeleton rows show while a page loads, and a
failed load shows an error with a Try again button instead of "No
deliveries found", and polling stops until you retry. If a later refresh
fails, the loaded rows stay with a notice that they may be out of date,
and polling continues.
- Retry and Send test event refresh every cached page of the endpoint's
deliveries. Switching endpoints starts again on page 1.
- Retry from the details sheet now works for a delivery that is not on
the current page.
- A pending delivery has no result yet, so its row no longer opens the
details sheet. Its Retry button is unchanged.
- Removed the "Attempt" field from the details sheet. It was the row's
position on the page, not an attempt number. A real one needs the API to
return it (CTRL-1974).

## Review instructions

1. Enable the Platform Webhooks feature preview, open an endpoint, and
send 7 test events (limited to 10 per minute).
2. Page 1 shows 5 deliveries, Previous is disabled and Next is enabled.
Next shows the other 2 and disables Next. Previous goes back to the
first 5.
3. On an endpoint with exactly 5 deliveries, both buttons are disabled.
4. In DevTools > Network, set throttling to "Slow 4G" and click Next.
Skeleton rows show. Then block the `deliveries` request and click Next.
"Failed to retrieve deliveries" shows with a Try again button. Wait 10
seconds: no new `deliveries` requests are sent. Unblock the request and
click Try again to load the rows. Also block the request while rows are
loaded: they stay, and an "Unable to refresh deliveries" notice appears
within about 5 seconds and clears once you unblock.
5. Open the details sheet from the bottom row of page 1. In a second
tab, send a test event and wait about 5 seconds. Click Retry delivery in
the first tab. A toast and a `POST .../retry` request appear, even
though the row has moved off page 1.
6. Set the endpoint URL to `https://httpbin.org/delay/10` and send a
test event. While the new row shows `pending` (about 10 seconds),
clicking it does nothing. Once it shows `success`, it opens the sheet.
2026-10-28 14:36:11 +02:00
Francesco SansalvadoreandClaude Sonnet 5 84115482be feat(studio): storage lifecycle policies UI (#52318)
## Problem

Lifecycle policies can only be set with an abstracted ui that hides the
actual underlying policies but the user can still modify the policies
via api, which would result in an un-documented drift from the policies
set via said abstracted ui.

## Solution

Show ui with list of effective policies applied and show if the policies
drifted in a way that is incompatible with the abstracted ui in the
"Create/Edit bucket modal".

<img width="1489" height="800" alt="Screenshot 2026-10-26 at 18 35 39"
src="https://github.com/user-attachments/assets/9e64f123-c06e-4cfe-9dba-839fae61c845"
/>

<img width="1439" height="847" alt="Screenshot 2026-10-26 at 18 35 50"
src="https://github.com/user-attachments/assets/a32d3a27-6719-48b3-abd2-fb134158bd96"
/>

<img width="654" height="316" alt="Screenshot 2026-10-26 at 18 36 38"
src="https://github.com/user-attachments/assets/0710c139-9b64-42f7-b410-c1a351b1f616"
/>

This PR also updates copywriting around the effects procured by the
lifecycle policies settings in the bucket settings modal.

<img width="704" height="440" alt="Screenshot 2026-10-26 at 18 35 17"
src="https://github.com/user-attachments/assets/f4fa03d1-e11b-4d08-b4f5-d94b2d9350a3"
/>

<img width="351" height="82" alt="Screenshot 2026-10-26 at 18 35 28"
src="https://github.com/user-attachments/assets/6ff1e149-92e0-4fd8-bfb5-0177afe207aa"
/>

## To review

- create a file storage bucket, enable object versioning and set some
lifecycle policy values
- once created, go to /project/_/storage/files/policies and find the
bucket policies or navigate to it from the "Edit bucket settings" via
the "View rules" button
<img width="1133" height="725" alt="Screenshot 2026-10-27 at 14 50 52"
src="https://github.com/user-attachments/assets/ef014f7a-5db6-413a-af53-a5648309b2c3"
/>
- adding extra policies should result in a "This bucket has a custom
lifecycle policy" message in the edit bucket modal

<img width="557" height="130" alt="Screenshot 2026-10-27 at 14 52 23"
src="https://github.com/user-attachments/assets/cde29748-65d9-45b5-a54b-55737d78d311"
/>

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-28 11:43:00 +01:00
d4b9d1240c refactor(studio): remove the legacy edge function overview (#52281)
The `edgeFunctionsOverview` flag is fully rolled out, so the edge
function Overview page now always renders the new Overview. This removes
the legacy Overview and everything only it used.

- **Overview page**: renders `EdgeFunctionOverview` directly, like the
other function tabs. The flag check and the loader shown while flags
load are gone.
- **`EdgeFunctionRecentInvocations`** and its utils: only the legacy
Overview showed this list.
- **`components/ui/Charts/AreaChart`**: the legacy Overview was its last
importer. The other `AreaChart` uses are recharts' own.

**Self-hosted:** flags never load off-platform, so self-hosted Studio
always got the legacy Overview. Its Overview tab is already hidden, and
the new Overview sends a direct visit to the Details tab, so nothing
reachable from the UI changes.

After this ships, the `edgeFunctionsOverview` flag can be deleted in
ConfigCat.

### How to test

1. Open an edge function's Overview on platform. It shows the new
Overview, with no loader flash while flags load.
2. Self-hosted: open `/project/default/functions/<slug>` directly. It
redirects to the Details tab.

### Validation

- Studio typecheck, lint, Prettier and knip pass on this layer.
Functions and Charts unit tests pass.

### Stack

Merge in order:

1. #50953 — reusable logs table building blocks
2. #50954 — function-scoped unified logs queries
3. #50955 — slimmer function detail layout, header on Overview
4. #50957 — Invocations merged into a function-scoped Logs tab
5. #50958 — Overview errors in the shared logs table
6. #52281 — remove the legacy Overview

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Jordi Enric <jordi.err@gmail.com>
2026-10-28 09:19:25 +01:00
7f7ebf527b feat(studio): use shared logs table for recent function errors (#50958)
The Overview's "Errors in the last 24h" section now uses the Logs tab's
queries (#50954) and the read-only `EmbeddedLogsTable` (#50953) instead
of its own SQL and table. It previews the latest five errors since the
last deploy, capped at 24h, shows "+N more" when there are more and
links to the rest. It's behind the `edgeFunctionsOverview` flag, like
the rest of the new Overview.

- Rows have no multi-select checkbox. Clicking one opens it in the Logs
tab with the same range and error filter, and "View logs" and "+N more"
open the filtered list.
- With the unified logs preview off, those links open the pre-unified
Invocations tab (for invocation rows) or Logs tab (for runtime rows),
using those tabs' own `its`/`ite`/`log` params.
- "Explain with AI" and "Copy summary" send the previewed errors to the
Assistant with the same prompt as selected logs on the Logs page. The
prompt also notes how many errors were left out.
- One count query, scoped to the function and unfiltered, gives both the
error count behind "+N more" and the invocations since the deploy, from
its level and log type facets. It replaces the hand-built invocation
count SQL, so the section runs two queries instead of three.
- The row query fetches only the five errors shown, through a new
`pageSize` option on `useUnifiedLogsInfiniteQuery`.
- The section uses the edge function preset from #50957, so it runs the
Logs tab's scoped queries and shares its saved columns.
- The custom error grouping and its SQL are removed. Net, the PR removes
about 390 lines.

### How to test

1. With `edgeFunctionsOverview` on, open a function that has recent
errors. You should see up to five rows without checkboxes, and "+N more"
when there are more.
2. Click a row with the unified logs preview on. It opens the Logs tab
with that log selected. Turn the preview off and click an invocation row
and a runtime row. They open Invocations and Logs respectively.
3. Use Explain with AI and Copy summary and check the prompt.
4. For a function with no errors since the last deploy, the section
shows the invocation count instead.

### Validation

- MSW component tests: preview rows and "+N more", no checkboxes, the
summary prompt, row links with the preview on and off, and the no-errors
state. They also check the row query asks for five rows and that a
single unfiltered count runs. `pageSize` and the facet count helper have
unit tests.
- Studio typecheck, lint ratchet, Prettier and knip pass on this layer.

### Stack

Merge in order:

1. #50953 — reusable logs table building blocks
2. #50954 — function-scoped unified logs queries
3. #50955 — slimmer function detail layout, header on Overview
4. #50957 — Invocations merged into a function-scoped Logs tab
5. #50958 — Overview errors in the shared logs table
6. #52281 — remove the legacy Overview

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Jordi Enric <jordi.err@gmail.com>
2026-10-27 16:47:51 +01:00
5d52b00f70 feat(studio): combine function invocations and logs (#50957)
With the unified logs preview on, an edge function's Logs tab renders
the unified logs view scoped to that function (#50954), with its
invocations and runtime output in one list. That replaces the separate
Invocations and Logs tabs.

- `UnifiedLogs` takes a `scope` plus view props: `hasFilterSideBar`,
`offeredFilters` and `columnPreferencesKey`. The function Logs tab turns
the sidebar off, which also drops the filters-toggle shortcut, and saves
its columns and panel layout separately from the Logs page.
- `getEdgeFunctionLogsScope` and `EDGE_FUNCTION_LOGS_VIEW` are the edge
function preset: the scope's fixed filters, the filters the tab offers
and its saved-columns key. It offers date, log type, level and message,
so no user filter, since no function row has a user.
- The Invocations tab and its shortcut are hidden. Old Invocations links
redirect to Logs, converting `its`/`ite`/`log` to `date`/`id`.
- `getEdgeFunctionLogsUrl` builds links into the scoped tab with the
shared params serializer from #50953, and clicking a bar on the
invocations chart uses it.

With the preview off, both tabs work as on master.

### How to test

1. Turn on the unified logs preview and open an edge function's Logs
tab. You should see only that function's invocations and runtime logs,
with the filter bar limited to date, log type, level and message.
2. Filter to Edge Function runtime, then to errors, and check counts and
the chart follow.
3. Open an old `/functions/<slug>/invocations?its=…&ite=…&log=…` link.
It lands on Logs with the same range and log selected.
4. Click a bar on the Overview invocations chart. The Logs tab opens on
that bucket.

### Validation

- URL helper, offered filter and preset tests, plus the scoped query
tests from #50954.
- Studio typecheck, lint ratchet, Prettier and knip pass on this layer.

### Stack

Merge in order:

1. #50953 — reusable logs table building blocks
2. #50954 — function-scoped unified logs queries
3. #50955 — slimmer function detail layout, header on Overview
4. #50957 — Invocations merged into a function-scoped Logs tab
5. #50958 — Overview errors in the shared logs table
6. #52281 — remove the legacy Overview

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Jordi Enric <jordi.err@gmail.com>
2026-10-27 14:54:56 +01:00
Lukas BernertandClaude Fable 5 de32f3130b fix(studio): show compute size labels on infrastructure surfaces (#52170)
## Problem

We don't want to mention raw AWS instance type names. Instead only
display the actual instance size name (e.g. "Small", "Medium", ...).

Fixes PROD-673

## Solution

Add a `getComputeSizeLabel` helper (`apps/studio/lib/compute-labels.ts`)
that maps `infra_compute_size` to its display label (`medium` →
"Medium", `2xlarge` → "2XL", …) and returns `undefined` for unknown
values so callers render nothing instead of a raw value.

Studio elements changed:

- Read replica details: "Compute Size" field
(`/project/<project_id>/settings/infrastructure/replica/<replica_id>`)
- Infrastructure diagram: primary and replica node cards
(`generateNodes` now receives the label; replicas always match the
primary's compute size) (`/project/_/settings/infrastructure`)
- Map view: "AWS • {size}" line in the region popup
(`/project/<project_id>`)
- HA pooler node cards (`useHaPoolerCard`)

Also removes the `size` field from the create-replica request (API
ignores it).

Unit tests cover the new helper, including the unknown-value case. The
existing `project_homepage:show_instance_size` feature flag keeps gating
the label as before.

## Review instructions

1. Open a project's Infrastructure settings page
(`/project/_/settings/infrastructure`).
2. Check the diagram node cards and (for projects with replicas) the map
view popup: compute shows as "Small"/"Medium"-style labels matching the
project's compute badge.
3. Open a read replica's details page: the "Compute Size" field shows
the same label.
4. Open the add-replica dialog and submit: the request body contains
only `read_replica_region`.

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-10-27 14:47:27 +01:00
Alaister YoungandAlaister Young f9e0376951 fix(studio): reload once on chunk load failures (#52380)
When a lazy-loaded JS/CSS chunk fails to load (flaky or mobile
networks), users land on the global error screen and stay there until
they refresh by hand. This reloads the page once instead, in both
runtimes.

A reload is the only reliable recovery: WebKit (Safari and every iOS
browser) caches a failed module fetch in the document's module map, so
every later `import()` of that URL fails instantly until the page is
replaced. TanStack's `lazyRouteComponent` already reloads once for route
chunks, but it keys its guard on the error message, and Safari's message
("Importing a module script failed.") is the same for every chunk and
survives reloads, so after the first time in a tab it never reloads
again. Non-route lazy imports (`next/dynamic`, `React.lazy`, Monaco) had
no recovery at all.

**Added:**
- `lib/chunk-load-error.ts`: `isChunkLoadError` (Chrome, Firefox,
WebKit, webpack `ChunkLoadError` and Vite's CSS preload wording) and a
reload guard
- The guard is time-based (`sessionStorage`, 30s window), not
message-based: a second failure within 30s of a reload shows the normal
error screen instead of looping. It's also capped at 3 automatic reloads
per tab, and the guard is read back after writing it. If storage is
unavailable, or silently drops the write, it never reloads
- Unit tests for every message form, the guard window, the per-tab cap,
and broken, missing or write-dropping storage

**Changed:**
- The global error boundary in `pages/_app.tsx` and `routes/__root.tsx`,
plus TanStack's root `errorComponent`, reload once for chunk-load errors
and render nothing while the reload is in flight. Fallbacks only peek at
the guard during render; the reload is claimed after commit
(`useChunkLoadReload`), so a discarded render can't use up the guard
- Chunk-load errors that a reload recovers from are no longer reported
to Sentry. One that recurs within the guard window (the user actually
saw the error screen) is reported, tagged `chunkLoadError: true`

No `vite:preloadError` listener: it also fires for hover/intent route
preloads, so reloading on it would refresh the page under someone who
only hovered a link.

## To test

- On the preview, open DevTools → Network, block one route chunk URL
(e.g. the SQL editor's), then navigate to it: the page reloads once and
recovers (unblock after the reload), with no error screen flash
- Keep the chunk blocked: after the one reload you get the normal error
screen, not a reload loop
- Repeat after 30s+ in the same tab: it reloads again
- Sentry: the recovered reload sends no event; the persistent failure
sends one tagged `chunkLoadError`
- Normal navigation and genuine non-chunk errors behave as before

---------

Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
2026-10-27 20:50:25 +08:00
080b888e6b feat(studio): slim edge function detail layout and move header to Overview (#50955)
The edge function detail layout is now breadcrumbs plus tabs
(`PageNav`), without the page header, so tabs like Logs and Code get the
full height below the tabs. The function name, invoke URL and last
deploy details move into a header on the Overview tab, which also holds
the chart period selector. Both the new and legacy Overview render it,
and both now default to a 1 hour period instead of 15 minutes.

The Overview sections (invocations, errors, performance and usage) now
sit in one default-width `PageContainer` instead of each nesting a
full-width one, and the invocations chart moves into a chart card.
Invocations has no section heading, since it's the headline metric right
below the page header.

Both overview versions use the same chart periods. Sparse chart data is
filled only between returned API buckets, avoiding synthetic zeros
outside the reported range. Chart navigation uses the full rolling
period, including a full day for the 1 day option.

The selector shows a checkmark for the selected period, and the header
announces loaded details. Self-hosted Studio retains a Copy URL action
in the detail toolbar because it has no Overview tab.

This layer doesn't depend on the logs changes below it.

**Heads-up:** the header now only appears on Overview. Code, Details,
Invocations and Logs show breadcrumbs and tabs only. This change isn't
behind a flag.

### How to test

1. Open an edge function's Overview. The header shows the name, URL
(with copy) and last deploy hover card, and the period selector sits in
the header with 1 hour selected.
2. Switch through the other tabs. Breadcrumbs and tabs stay sticky, and
there's no header.
3. With the `edgeFunctionsOverview` flag off, the legacy Overview
renders with the same header.

### Validation

- 104 focused tests pass with retries disabled and shuffled order (seed
50968). New tests cover both overview versions, period changes, empty
results, header loading and copying, and self-hosted URL copying. Test
names describe observable behavior.
- 12 targeted regression mutations were detected and restored; the
selected-indicator mutation was repeated after the visual alignment fix.
- Browser QA on the staging preview for `3d055c0dc4` covers the header
and deploy details, copied URL, period changes, all detail tabs, sticky
navigation, the legacy overview, and empty results. Temporary local flag
overrides were removed. The final test-only commit `5af6a2896b` has
identical production code; its matching preview also passed header,
URL-copy, period-switching, and Settings smoke checks.
- Independent code review and changed-file formatting checks pass. All
40 executed CI checks pass on `5af6a2896b`, including TypeScript/lint,
unit tests, Next.js and TanStack E2E tests, and builds. All six review
threads are resolved.

### Stack

Merge in order:

1. #50953 — reusable logs table building blocks
2. #50954 — function-scoped unified logs queries
3. #50955 — slimmer function detail layout, header on Overview
4. #50957 — Invocations merged into a function-scoped Logs tab
5. #50958 — Overview errors in the shared logs table
6. #52281 — remove the legacy Overview

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Jordi Enric <jordi.err@gmail.com>
2026-10-27 09:29:10 +01:00
Charis 5d8499b6f1 chore(eslint): allowlist grant and connectionString in query exhaustive-deps (#52334)
## Problem

`@tanstack/query/exhaustive-deps` flags every variable used in a
`queryFn` that isn't in the `queryKey`. Some variables are intentionally
left out because they don't change the returned data, and keeping them
out of the key avoids splitting the cache:

* **`connectionString`** in queries that run SQL against the user's
database. These currently need `eslint-disable` comments or count
against the ratchet.
* **`grant`**, the FGA grants that Studio data hooks now take (see
#52331). Every migrated query would otherwise need a disable comment.

The installed plugin (5.91.2) has no way to configure this.

## Solution

* Upgrade `@tanstack/eslint-plugin-query` from `^5.0.0` (resolving
5.91.2) to `^5.104.5`. The rule's `allowlist` option arrived in 5.95.0.
5.105.0 is newer than our pnpm minimum release age allows.
* Allowlist `grant` and `connectionString` for `exhaustive-deps` in
`eslint-config-supabase/next.js`.
* Remove the 11 disable comments in Studio that only suppressed
`connectionString`.
* Six disable comments stay, because they suppress other dependencies:
  * `ReportBlock.tsx`
  * `UserJourneys.queries.ts`
  * `github-config-query.ts`
  * `bucket-objects-infinite-query.ts`
  * `table-rows-query.ts`
  * `useSingleLog.tsx`
* Lower Studio's `@tanstack/query/exhaustive-deps` baseline from 87 to
28.

The upgraded rule is stricter than 5.91.2: without the allowlist it adds
about 18 warnings. With the allowlist, the total drops well below the
old baseline, because many existing warnings were unsuppressed
`connectionString` omissions.

The lockfile changes are the plugin and its `@typescript-eslint`
dependencies. The graphiql entries are re-keyed by pnpm's peer
resolution; their versions are unchanged.

## Testing

* `pnpm --filter studio run lint:ratchet` passes.
* ESLint is clean on each file where a disable comment was removed.
* Other apps' ratchets only track `shadcn/*` rules, so they're
unaffected.
2026-10-27 09:27:44 +01:00
Danny White fdab2cc751 feat(studio): interrupt serious account recovery gaps (#51643)
## Problem

Users with serious recovery gaps may never visit Account Security, so a
manually accessible reminder is easy to miss.

## Solution

Show the existing reminder as a full-screen layout takeover after
required MFA verification and successful account reads. Keep the
original URL, query and fragment intact. The dashboard stays mounted but
inert, preserving unsaved work; dismissal reveals it. Wait for existing
dialogs to close. Keep rollout gating, eligibility and snooze unchanged.
A successfully resolved background check dismisses an untouched
takeover; started tasks and completed rows remain until Continue.


Both of these recovery flags are enabled via ConfigCat for local and
staging:
- `enableAccountRecoveryInterstitial`: this work
- `enableAuthRecoveryCodes`: the work it depends on

We’ll only flip these to `true` for production once all of this is
merged and heavily tested.

| Interruption Example |
| --- |
| <img width="654" height="800" alt="16563"
src="https://github.com/user-attachments/assets/eec71acf-78ab-473d-a9d3-9c6cdc3aff07"
/> |

The dashboard remains usable while eligibility loads. An open takeover
stays in place through background refreshes. Signing out clears
in-memory reminder state so clearing browser snooze permits retesting.

## Review instructions

1. Open [this PR’s staging
preview](https://studio-staging-git-dnywh-account-recovery-interstitial-supabase.vercel.app/dashboard/organizations)
with a non-SSO test account and complete required MFA verification.
Check `enableAccountRecoveryInterstitial` and `enableAuthRecoveryCodes`
are both true in the staging dev toolbar. Close the toolbar and other
dialogs.
2. **Exhausted codes:** use an account with existing codes and exactly
one verified authenticator. Override GET `/factors/recovery-codes` in
DevTools Network: retain JSON fields, set `remaining` to `0` and save.
Clear `account-recovery-reminder:<userId>` from Local Storage for this
preview origin, then reload. Make sure you are **not** on
`dashboard/account/security` as that won’t show the interstitial.
Confirm the request uses the override and the takeover opens without
changing the URL.
3. **Missing codes, separate scenario:** disable overrides and use an
MFA test account with no generated codes. Clear snooze and reload. A
zero remaining count simulates exhausted codes, not missing codes. A
second verified authenticator prevents the exhausted-code trigger, but
not the missing-code trigger.
4. Skip, reload and switch projects or organisations. Confirm snooze
persists. A different account must have separate reminder state. For
warning-to-critical escalation, generate codes on the missing-code
account, then override its remaining count to zero and reload without
clearing the warning snooze.
5. Disable overrides before live actions. Save codes or add an
authenticator, then Continue. Confirm the page and URL remain intact.
Tab and Command/Ctrl+K must not reach dashboard controls; nested dialogs
must still work. Editor draft and browser-history preservation are also
covered by component tests.
6. With snooze cleared, open a project URL containing a query and
fragment; opening and dismissing the takeover must leave that full URL
unchanged. Check account settings, sign-in, MFA verification and
consent/connection flows remain uninterrupted. A healthy account, failed
reads or a disabled rollout flag must not trigger a takeover.
7. Throttle the status request: the dashboard stays usable while
eligibility loads. If another dialog is already open, the takeover waits
until it closes. There is no standalone recovery route or runtime mock
parameter.
2026-10-27 12:42:05 +11:00
Danny White e2ec13d9a6 feat(studio): snooze recovery reminders per browser (#52124)
## Problem

Skipped recovery reminders need a consistent reminder interval for each
signed-in person in the browser.

## Solution

Snooze missing codes for thirty days and exhausted codes for seven days.
Escalation breaks snooze; sign-out preserves it. Completing codes, or
adding a backup factor for exhausted codes, resolves the applicable gap.
Track task actions, completion and dismissal.

## Review instructions

**This PR’s own deploy preview cannot show the takeover.** Review its
diff here, but test the assembled stack on [#51643’s staging
preview](https://studio-staging-git-dnywh-account-recovery-interstitial-supabase.vercel.app/dashboard/organizations).
The controller only mounts in #51643.

Before each scenario: use a non-SSO staging test account with MFA
verified; check `enableAccountRecoveryInterstitial` and
`enableAuthRecoveryCodes` are both true in the staging dev toolbar, then
close the toolbar and other dialogs. Clear
`account-recovery-reminder:<userId>` from DevTools Application → Local
Storage **for that preview origin**, then reload the dashboard.

1. Use an account with existing codes and exactly one verified
authenticator. Override GET `/factors/recovery-codes` in DevTools
Network: retain JSON fields, set `remaining` to `0`, save and reload.
Confirm the overridden request succeeds and the takeover opens.
2. Skip. Confirm the URL stays unchanged and the local-storage record
has critical severity with expiry seven days ahead. In a separate
scenario, genuinely missing codes should record warning severity with
expiry thirty days ahead.
3. Reload, switch projects or organisations, then sign out and back in.
The reminder stays hidden. Clear the record and reload to retest.
4. Disable overrides before live actions. Save codes and Continue; the
record clears. Adding a second authenticator resolves exhausted codes
but must not resolve missing codes. Use separate test accounts for these
cases.
2026-10-27 12:42:05 +11:00
Danny White eec2d0f947 feat(studio): offer a backup authenticator in the recovery reminder (#52123)
## Problem

A recovery reminder should let users save codes and add a backup
authenticator independently, with clear loading and completed states.

## Solution

Add an optional authenticator task for accounts with one verified
factor. Keep completed rows visible, use text shimmers while loading,
and dismiss an untouched takeover when a successful refresh confirms the
gap is resolved. Continue and Skip dismiss through the same callback
used by the layout takeover.

| State | Screenshot |
| --- | --- |
| Loading | <img width="654" height="800" alt="40913"
src="https://github.com/user-attachments/assets/d75585f0-5d00-46db-9ec7-1305da0f7464"
/> |
| Multiple issues | <img width="654" height="800" alt="Supabase"
src="https://github.com/user-attachments/assets/8342667c-ecce-4271-a418-41295ebba223"
/> |
| One issue fixed | <img width="654" height="800" alt="15927"
src="https://github.com/user-attachments/assets/693c37fe-e955-4c9d-b866-1c60743a31b8"
/> |
| Both issues fixed | <img width="654" height="800" alt="59618"
src="https://github.com/user-attachments/assets/46140e95-b686-41ab-a5ea-94016f7eda29"
/> |

## Review instructions

**This PR’s own deploy preview cannot show the takeover.** Review its
diff here, but test the assembled stack on [#51643’s staging
preview](https://studio-staging-git-dnywh-account-recovery-interstitial-supabase.vercel.app/dashboard/organizations).
The controller only mounts in #51643.

Before each scenario: use a non-SSO staging test account with MFA
verified; check `enableAccountRecoveryInterstitial` and
`enableAuthRecoveryCodes` are both true in the staging dev toolbar, then
close the toolbar and other dialogs. Clear
`account-recovery-reminder:<userId>` from DevTools Application → Local
Storage **for that preview origin**, then reload the dashboard.

1. Use a test account with missing codes and exactly one verified
authenticator. Cancel Add authenticator, then reopen and enrol a test
authenticator. Confirm only that row completes and Skip for now becomes
Continue. Generate and acknowledge codes; both completed rows stay
visible. These actions change the test account.
2. **Separate exhausted-code scenario:** use an account that still has
exactly one verified authenticator. Override GET
`/factors/recovery-codes` in DevTools Network: retain JSON fields, set
`remaining` to `0`, clear snooze and reload. An account with two
verified authenticators will not trigger for exhausted codes. Disable
overrides before live actions.
3. For the codes-only layout, use an account with two verified
authenticators and genuinely missing codes. Repeat at a narrow viewport.
Loading, unavailable and externally resolved states have component-test
coverage; healthy or failed reads must not trigger a takeover.
2026-10-27 12:29:11 +11:00
Danny White 749386567d feat(studio): fix recovery codes inside an interstitial (#52122)
## Problem

Users need to fix missing or exhausted recovery codes without leaving
the recovery reminder.

## Solution

Add a reusable recovery reminder and full-screen modal shell using the
existing recovery-code dialogs. Dismissal is a callback. The automatic
layout gate in #51643 mounts the UI; there is no standalone preview
route.

| State | Screenshot |
| --- | --- |
| Blocked request | <img width="654" height="800" alt="39307"
src="https://github.com/user-attachments/assets/2ba80ea7-24ad-4d29-ab50-730890501014"
/> |
| Recovery codes used up | <img width="654" height="800" alt="Supabase"
src="https://github.com/user-attachments/assets/5dd63735-1254-4855-bbd8-04c2e4c699fa"
/> |
| No recovery codes | <img width="654" height="800" alt="Supabase"
src="https://github.com/user-attachments/assets/58ff5b91-7da6-4c39-ad99-cea7cce8cf73"
/> |
| Recovery codes saved (just completed above _Generate codes_ step) |
<img width="654" height="800" alt="63500"
src="https://github.com/user-attachments/assets/1fc7ca56-a7cb-4edd-a3cd-4d8cf5c09659"
/> |


## Review instructions

**This PR’s own deploy preview cannot show the takeover.** Review its
diff here, but test the assembled stack on [#51643’s staging
preview](https://studio-staging-git-dnywh-account-recovery-interstitial-supabase.vercel.app/dashboard/organizations).
The controller only mounts in #51643.

Before each scenario: use a non-SSO staging test account with MFA
verified; check `enableAccountRecoveryInterstitial` and
`enableAuthRecoveryCodes` are both true in the staging dev toolbar, then
close the toolbar and other dialogs. Clear
`account-recovery-reminder:<userId>` from DevTools Application → Local
Storage **for that preview origin**, then reload the dashboard.

1. **Exhausted codes:** use an account with existing codes and exactly
one verified authenticator. In DevTools Network, right-click GET
`/factors/recovery-codes` → **Override content**. Keep the JSON fields,
set `remaining` to `0`, save and reload. Confirm the request shows the
overridden response and the takeover opens.
2. **Missing codes, separate scenario:** disable overrides and use an
MFA test account with no generated codes. Clear snooze and reload.
Setting `remaining` to `0` simulates exhausted codes, not missing codes.
3. Disable overrides before live actions. Cancel regeneration to check
existing codes remain intact, then generate or regenerate codes and
acknowledge storage. These actions change the test account. Continue or
Skip should reveal the unchanged URL and page.
2026-10-27 12:29:10 +11:00
Danny WhiteandJoshen Lim df8aca1fb2 refactor(studio): share recovery setup dialogs (#52121)
## Problem

The same recovery setup needs to work from Account Security and the new
recovery interstitial without duplicating dialog behaviour.

## Solution

Share the generation and regeneration flow, and report completion only
after codes are acknowledged or an authenticator is verified. Keep the
existing Account Security entry points. This PR provides the dialog
foundation; #52122 and #52123 consume its callbacks, and #51643 mounts
the takeover.

## Review instructions

1. Open [Account
Security](https://studio-staging-git-dnywh-recovery-shared-dialogs-supabase.vercel.app/dashboard/account/security)
in staging, or `/account/security` locally, using a disposable test
account.
2. Generate recovery codes. Confirm Done stays disabled until the save
acknowledgement is checked, then closes the dialog.
3. Regenerate codes. Cancel the confirmation first and confirm nothing
changes; repeat and confirm the replacement codes appear.
4. Open Add authenticator and cancel. Then complete enrolment with a
test authenticator; confirm it appears only after verification.

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2026-10-27 12:29:10 +11:00
Pamela Chia 092b8ff518 fix: repair 404s from legacy dashboard routes, docs links, and the changelog feed (#52292)
Several supabase.com URLs still return a 404 to real browsers every day:
an old Database Hooks route, card icons for brands we never shipped an
image for, two dashboard links to docs pages that miss the `/guides`
prefix, and a few URLs that search engines and feed readers keep
requesting.

**Changed:**
- **Old Database Hooks links land on Webhooks**: #29671 renamed
`/project/:ref/database/hooks` without a redirect, so bookmarks and
older guides hit a 404. I added a redirect to the Integrations Webhooks
page, the same target as the existing `database/webhooks` redirect.
- **Card brands without an icon show a generic card**: payment method
rows built the image URL straight from the card brand name, so UnionPay
and other brands without a PNG rendered a broken image. I added a
`CardBrandIcon` in `CreditCard.tsx`, used by both views, that only
requests the brand images we ship, labels each with its brand name, and
shows a generic card icon for every other brand.
- **Branching "Learn more" links open the right docs**: #51393 linked
the branching empty state to `/docs/deployment/branching/...` without
`/guides`. I fixed both links and added a redirect for the GitHub
integration URL, which search engines already indexed (the dashboard one
already had a redirect).
- **Indexed docs and feed URLs redirect**: I added redirects for
`/docs/guides/mcp`, the old hashed architecture diagram path that other
sites still embed, and `/changelog/rss.xml`. I also added an RSS
`alternate` link to `/changelog` so feed readers find
`/changelog-rss.xml` instead of guessing.

**Note:** Studio and www changes are independent, so either app can
deploy first.

## To test

Tested on the PR preview:
- [x] Open `/dashboard/project/<ref>/database/hooks`, expect a redirect
to `/dashboard/project/<ref>/integrations/webhooks/overview`
(`database/hooks-nope` still 404s)
- [x] Open org billing with a Visa or Mastercard on file, expect the
brand logo as before
- [x] With a card whose brand has no image (e.g. UnionPay), expect a
generic card icon instead of a broken image in the payment methods list
(checked with a mocked UnionPay row: generic icon, no `unionpay.png`
request, Visa rows unchanged)
- [ ] Same check in the plan change payment method select (not
exercised: reaching it starts the plan change flow)
- [x] On a project without branching, open Branches and click both
"Learn more" buttons, expect the dashboard and GitHub integration
branching guides to load
- [x] On the www preview, open `/changelog/rss.xml`, `/docs/guides/mcp`
and `/docs/deployment/branching/github-integration`, expect 308s to
`/changelog-rss.xml`, `/docs/guides/ai-tools/mcp` and
`/docs/guides/deployment/branching/github-integration`
- [x] View source on `/changelog`, expect a `rel="alternate"` RSS link
to `/changelog-rss.xml`

## Linear
- fixes GROWTH-1364
2026-10-26 17:32:06 +00:00
Alaister Young c127901b64 test(studio): speed up flaky replication tests (#52326) 2026-10-27 01:21:54 +08:00
Drew McLellanandFrancesco Sansalvadore d98c277790 feat(studio): rotate Storage URL signing keys FE-4433 (#52165)
## Problem

Rotating a project's Storage URL signing key currently needs a support
ticket, so customers can't rotate on their own timeline or keep a
standby key until their signed URLs have migrated.

Linear:
[FE-4433](https://linear.app/supabase/issue/FE-4433/allow-users-to-rotate-storage-url-signing-keys-via-ui)

## Solution

Adds a URL signing keys page at `/project/{ref}/storage/signing-keys`,
linked from the Storage menu. It builds on the design prototype from
`feat/storage-rotate-signing-keys` and follows the current JWT Keys page
styling.

- Active key, standby key, and revoked keys are shown in separate
tables, so there is only ever one active key. The UI allows one standby
key at a time.
- Create a standby key (ES256 by default, HS512 optional), rotate the
standby key to active, revoke a standby key, or move a revoked key back
to standby.
- The key list reports JWK types (`EC`, `oct`), which are mapped to
ES256 and HS512 labels. Unrecognized types fall back to the raw value.
- Telemetry: `storage_url_signing_key_created` and
`storage_url_signing_key_updated` (with a `change` property), fired when
the action succeeds.
- A "Created at" column is not included yet because the keys endpoint
doesn't return it. It will follow in a later PR.

<img width="1272" height="846" alt="Screenshot 2026-10-23 at 11 43 45"
src="https://github.com/user-attachments/assets/980742ed-6c4e-43d1-b170-847e550fde4c"
/>


## Review instructions

1. Open the preview and go to Storage > URL signing keys on a project.
2. Create a standby key, then rotate it to active. The previous active
key should move to standby.
3. Revoke the standby key (type its ID to confirm), then move it back to
standby from the revoked table.
4. Compare the table styling with Project Settings > JWT Keys.
5. Check that creating a standby key and moving a revoked key to standby
are disabled while a standby key exists.

## 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: Francesco Sansalvadore <f.sansalvadore@gmail.com>
2026-10-26 16:39:39 +00:00
Monica Khoury c31c7afb1b fix(studio): add latest-version hint to Postgres version field (#52143)
## Problem

On the General settings page, the Service versions card shows the
versions as disabled inputs. When a project is already up to date,
nothing explains that Postgres updates would show up in this section, or
where to learn more.

Resolves FE-4604:
https://linear.app/supabase/issue/FE-4604/add-hint-regarding-database-versioning

## Solution

Adds a subtle description under the Postgres version field, using the
existing `description` prop on `FormItemLayout`:

> This project is already on the latest version of Postgres that
Supabase supports. Updates will appear here when available. Learn more

"Learn more" links to the upgrading guide. It is tertiary information,
so it is a field description and not an admonition (changed after design
feedback).

It only shows when the project is on the latest version, database
upgrades are enabled, and the project is not on a K8s cloud provider.
The condition is one named boolean, `canShowLatestVersionHint`.
Component tests cover the visible case and the hidden cases.

## How to test

1. Run Studio and open a project's General settings page.
2. On a project already on the latest Postgres version, check that the
description appears under the Postgres version field, next to the
"Latest" badge.
3. Click "Learn more" and check that the upgrading guide opens in a new
tab.
4. On a project with an upgrade available, check that only the upgrade
alert shows and the description does not.
2026-10-26 18:20:05 +02:00
Julian Domke 90ba1183de fix(stripe-atlas): change message for simple link (#52323) 2026-10-26 17:13:16 +01:00
973dfa1b97 feat(studio): scope unified logs queries to one edge function (#50954)
Adds an optional `scope` to the unified logs search: fixed filters every
query applies on top of the user's, which the user can't remove. Nothing
sets a scope in this PR, so the Logs page is unchanged. #50957 uses one
to narrow the function Logs tab to one edge function.

A scope uses the same columns and operators as the `filter` URL param,
so any view can narrow logs to one resource without new query code.
Columns the query builder doesn't know match a `log_attributes` key, so
one edge function's logs are:

```ts
{
  filters: [
    { column: 'log_type', operator: '=', value: 'edge function' },
    { column: 'log_type', operator: '=', value: 'edge function runtime' },
    { column: 'function_id', operator: '=', value: functionId },
  ],
}
```

- New `edge function runtime` log type, read from the `function_logs`
source. Its level comes from the console level (`error`/`fatal` count as
errors, `warn`/`warning` as warnings), and its details stay in metadata.
- **Every scan**: the scope's filters apply to rows, counts, the chart
and single-facet queries. Facet scans never drop them, unlike the user's
own filter on the facet's column. Filters on the same column and
operator combine like the URL's (`=` values match any), every group must
match, and a scope replaces the default postgres + edge log types.
- **Fails closed**: a scope condition that can't be built matches no
rows, instead of being dropped like a bad user filter.
- **ClickHouse only**: scoped searches always run on ClickHouse,
whatever `otelUnifiedLogs` says, including downloads and the log detail
panel. The BigQuery queries are unchanged from master and throw on a
scope rather than return rows from outside it.
- `getLogTypeVisibility` offers only the log types a scope fixes.
Otherwise it keeps the new log type out of the filters, since the
project-wide Logs page already shows runtime logs inside each
invocation's detail panel.
- `toQuerySearchParams` and `createUnifiedLogsSearch` attach the scope.
- `UnifiedLogs` works out which log types its queries may use once,
instead of in each of its queries, filters and facets.

### How to test

1. Open the project Logs page with the unified logs preview on. The log
type filter shouldn't offer "Edge Function runtime", and default results
should match master.
2. The scoped behavior is easiest to try on #50957.

### Validation

- Query builder tests: the scope on every count scan, the chart and
facet queries, requests for out-of-scope log types, different operators
on one column, the fail-closed case, BigQuery refusing a scope, and
unscoped queries staying the same.
- Studio typecheck, lint ratchet, Prettier and knip pass on this layer.

### Stack

Merge in order:

1. #50953 — reusable logs table building blocks
2. #50954 — function-scoped unified logs queries
3. #50955 — slimmer function detail layout, header on Overview
4. #50957 — Invocations merged into a function-scoped Logs tab
5. #50958 — Overview errors in the shared logs table
6. #52281 — remove the legacy Overview

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Jordi Enric <jordi.err@gmail.com>
2026-10-26 16:52:15 +01:00
Monica Khoury 9ddf227359 fix(studio): clarify free Micro upgrade messaging on Pro upgrade (#51938)
## What
Replaces the "First project included..." admonition in the Pro upgrade
dialog with clearer copy that explicitly calls out the free Nano to
Micro upgrade, and shows it for any org upgrading from Free to Pro
(previously only showed when the org had exactly 1 project).

## Why
Users on the Free plan aren't aware that, after upgrading to Pro, their
first project's compute is already billed at Micro price and can be
switched from Nano to Micro at no extra cost. The old copy didn't make
that clear, and was hidden entirely for multi-project orgs.

Linear: FE-4667

## Testing
1. In Studio, go to an organization on the Free plan.
2. Open Billing Settings -> Subscription -> change plan -> select Pro.
3. Confirm the "Micro Compute included for one project" admonition
shows, with working links to Infrastructure settings and the compute
docs.
4. Repeat with an org that has 2+ projects -> confirm the admonition
still shows (previously it was hidden for multi-project orgs).
2026-10-26 17:24:42 +02:00
Gildas Garcia 8ea3ce7747 Fix: stabilize some long flaky units tests (#52297)
## Problem

Some of our units fail randomly because they can take a bit more than 5
seconds to complete

## Solution

Set their timeout to 10 seconds.
2026-10-26 16:22:58 +01:00
Charis 9391f60ec9 test(studio): add shared permissions mocks and testGrant helper (#52312)
## Problem

Components and fetchers are moving to endpoint-bound FGA grants, so more
tests need to mock `/platform/profile/permissions/v2` and mint grants.
Each test file currently defines its own permissions response type and
mock, and `testGrant` lives inside `guarded-fetch.test.ts`.

Resolves
[FE-4692](https://linear.app/supabase/issue/FE-4692/test-infra-global-msw-handler-for-v2-permissions-and-testgrant).

## Solution

* `tests/lib/permissions-fixtures.ts`: shared `PermissionsV2Response`
type, `ALL_FGA_PERMISSIONS`, `allPermissionsFor(slugs)` (grants
everything at the org level), and `NO_PERMISSIONS`.
* `tests/lib/msw-permissions.ts`: `mockPermissions(response)` and
`mockPermissionsError({ status, message })` on top of `addAPIMock`.
* `tests/lib/test-grant.ts`: `testGrant(endpoint, { variant,
organizationSlug, projectRef, permissionsProjectRef })` for unit tests
of fetchers and query options, moved out of `guarded-fetch.test.ts`.
* Existing tests that mocked the v2 endpoint now use the shared helpers.
`IndirectTaxDeclarationModal.test.tsx` keeps its own `addAPIMock`
because a test asserts the request was served.
* Documented in `apps/studio/tests/README.md` and the
`studio-mock-api-tests` skill.
2026-10-26 10:51:20 -04:00
Saxon Fletcher bc9bee459f refactor(studio): extract reusable logs table building blocks (#50953)
Extract shared logs tables and query helpers. Validate query parameters and preserve defaults, keep custom preview footers independent of pagination, and cover preview behavior and omitted log counts.
2026-10-26 13:06:29 +01:00
Charis 254e24b170 feat(studio): require grants in fetch wrappers for FGA-annotated endpoints (#52238)
## Problem

Resolves FE-4689 and FE-4690.

Builds on #52105. Studio's fetch wrappers don't know which FGA
permissions an endpoint requires, so a UI guard and the request it
protects can drift apart. This makes the `grant` minted by
`useGrant`/`getGrant`/`ensureGrant` part of the request itself: calling
an annotated endpoint without a matching grant is a compile error.

## Solution

### What changed

- **Fetch wrappers** (`data/fetchers.ts`, `data/guarded-fetch.ts`):
`get`/`post`/`put`/`patch`/`del` keep their names, so no imports change.
- The `grant` option is required for endpoints annotated with
`x-fga-permissions`, and forbidden for unannotated ones.
- It accepts a `Grant` for that exact endpoint (or one of its variants)
or `unguarded`.
  - The wrapper strips the grant before calling openapi-fetch.
  - `head`/`trace`/`options` are unchanged.
- **Owned params**: refinements can declare query params the wrapper
sets from the grant's variant (`ownedQuery`). These params are removed
from the init type (`Omit<Query, Owned> & { [K in Owned]?: never }`), so
callers can't pass them. Nothing uses this yet: the api-keys `reveal`
variant is the first.
- **`assertGrant`** runs in development only and throws
`GrantAssertionError`. It checks:
  - the endpoint;
  - a missing grant;
  - the variant against `when(init)` predicates;
- the path `ref` against the grant's project, also accepting the parent
project ref for a grant minted on a branch;
  - the path `slug` against the grant's organization.
- **Escape hatches**:
  - `unguarded.migrating` for unmigrated call sites.
- `unguarded.byDesign('reason')` for calls that intentionally skip the
check.
- **Grants** now record `permissionsProjectRef`, the ref permissions
were evaluated against. It's required once the scope is resolved.
- **Readable errors**: a missing or wrong grant reports the caller's own
init type plus the expected `grant` type, instead of openapi-fetch's
full options type. Under `noErrorTruncation`, the old message was tens
of KB per call site.
- **`executeSql`** now requires a grant for `POST
/platform/pg-meta/{ref}/query`, so every caller counts as unmigrated.
- **Codemod**: added `grant: unguarded.migrating` at every existing call
site that hits an annotated endpoint, including all `executeSql`
callers. No behavior change. A follow-up lint rule ratchets the count
down.
- **Dependencies**: adds `openapi-typescript-helpers` (the version
openapi-fetch already uses) for the helper types. Only openapi-fetch's
unexported `InitParam` is copied locally.

### Type-level notes

- The grant is checked in the parameter type rather than in `Init`'s
constraint. That way `Init` is still inferred from the argument, which
keeps both the return type and the error message tied to the caller's
code.
- The grant is replaced rather than intersected. Intersecting a wrong
grant with the expected one can reduce the init type to `never`, which
then accepts the call.
- `NoInfer<Path>` stops a grant's endpoint from becoming an inference
candidate for the path.

## Review instructions

### Tests

- `data/guarded-fetch.test.ts`:
- Type equality with the raw client: required params and body,
template-literal paths, `parseAs`, `signal`/`headers`, optional-init
endpoints, and `unguarded`. An openapi-fetch upgrade that breaks the
local `InitParam` copy fails typecheck.
  - Negative type cases:
    - a missing or `undefined` grant;
    - a missing init on an annotated endpoint;
    - a grant for a different path or method;
    - any grant or `unguarded` on an unannotated endpoint;
    - a forged grant;
    - params and body still checked;
    - an unknown path.
- `guardMethod` and `assertGrant` runtime behavior, including
branch-parent refs and org slugs.
- Variant and owned-param tests are deferred to the api-keys (`reveal`)
and pg-meta (`read`/`write`) PRs, since no refinements exist yet.

1. Run `pnpm typecheck` and confirm Studio passes. Then remove a `grant:
unguarded.migrating` and check that the error is short and names the
expected grant.
2. Run `pnpm test:studio`.
3. Skim the codemod commit: it only adds `grant: unguarded.migrating`
and the `unguarded` import.

## 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)
2026-10-26 07:58:22 -04:00
Charis e38c93e960 feat(studio): block read replica creation when upgrade crosses collation lineage (#52244)
## What

Read replica creation is now blocked when upgrading the primary's
Postgres would cross a collation lineage boundary. The check uses the
upgrade eligibility endpoint, and the lineage boundary logic is ported
from the platform. The blocker shows an admonition asking the user to
upgrade Postgres first, with a link to the upgrade section in General
settings.

- Multiple blockers on the replica dialog now collapse into a single
admonition.
- `useCheckEligibilityDeployReplica` now exposes `isLoading`, `isError`,
`error`, and `refetch`. The dialog shows a skeleton while loading and an
error with a Retry action on failure.

## Notes for reviewers

- Upgrade eligibility only runs for active, healthy projects, so other
projects are not blocked by this check.
- The admonition copy needs a messaging review.

## Testing

- Unit tests for the collation lineage util.
- Component tests for blocker collapsing, the loading state, and
error/retry.

Closes FE-4643
2026-10-26 07:56:40 -04:00
Gildas Garcia 54a271b0f8 Upgrade sonner to 2x and update toast design (#52003)
## Problem

Two issues:
- There's an accessibility issue with sonner before v2 as it applies
`role="status"` to an `li` element
- The custom Tailwind classes we pass are not applied and once applied
correctly, the design is not what we want

## Solution

- Upgrade sonner to v2 (the aria attribute are now applied to the toasts
container)
- Fix the design, especially the close icon and the upload usages (with
progression)

In all screenshots, the close button is only displayed when hovering the
toast.

<img width="384" height="73" alt="image"
src="https://github.com/user-attachments/assets/c34038f1-30ce-43d7-a031-81727d61592c"
/>

<img width="776" height="156" alt="image"
src="https://github.com/user-attachments/assets/ec27ff42-6887-4b12-a39b-262a3adacf6b"
/>

<img width="385" height="78" alt="image"
src="https://github.com/user-attachments/assets/c6b36ec9-881c-4dbe-a0c0-81b2b2b5053f"
/>

## Review instructions

On [Design
System](https://design-system-hgbzzl10s-supabase.vercel.app/design-system/docs/components/sonner):
- Check each example with extra attention to the loading/promise and
upload ones

On
[Studio](https://studio-staging-1nx2cwequ-supabase.vercel.app/dashboard/),
in the Table Editor:
- Create a new table by importing a CSV file and check there's only one
loading icon while the progress is shown (requires a quite big CSV as
it's fast)
- Then import more data in the new table
2026-10-26 09:45:23 +01:00