The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
chore(studio): remove legacy status banner and incidentIoStatusPage flag (#51852)
Charis27e6259a395e
diff --git a/apps/studio/TANSTACK_MIGRATION.md b/apps/studio/TANSTACK_MIGRATION.mdindex 5487cbd55f2..ba4eb81c527 100644--- a/apps/studio/TANSTACK_MIGRATION.md+++ b/apps/studio/TANSTACK_MIGRATION.md@@ -434,7 +434,7 @@ per-file items only when a subtree has special cases.- [x] `routes/api/get-ip-address.ts` — canary port (validates the shim)- [x] `routes/api/**` — root-level simple endpoints (`check-cname`,`cli-release-version`, `enabled-features-overrides`, `generate-attachment-url`,- `get-deployment-commit`, `get-utc-time`, `status-override`)+ `get-deployment-commit`, `get-utc-time`)- [x] `routes/api/ai/**` — AI endpoints (`docs.ts` direct-ported as Web-native)- [x] `routes/api/connect/**`- [x] `routes/api/content/**`@@ -444,8 +444,7 @@ per-file items only when a subtree has special cases.- [x] `routes/api/v1/**` — except `body.ts` (streaming rewrite)- [x] `routes/api/v1/projects/$ref/functions/$slug/body.ts` — Web-streams rewrite. Returns a `Response` whose body is a `ReadableStream`; each artifact file is converted via `Readable.toWeb(createReadStream(...))` and pulled chunk-by-chunk into the multipart stream. Skips the `apiWrapper` since `getFunctionsArtifactStore` already asserts self-hosted mode (the pages-router `withAuth` was a no-op outside `IS_PLATFORM`).- [x] `routes/api/mcp/index.ts` — uses `WebStandardStreamableHTTPServerTransport` from `@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js`. Takes a Web `Request`, returns a `Response` directly — no shim needed. Query parsing pulled from `request.url`'s search params; headers passed through unchanged.-- [x] `routes/api/incident-banner.ts`, `routes/api/incident-status.ts`,- `routes/api/status-page.ts` — App Router routes under `app/api/**`+- [x] `routes/api/status-page.ts` — App Router route under `app/api/**`(already Web-native, direct re-export)---diff --git a/apps/studio/app/api/incident-banner/route.ts b/apps/studio/app/api/incident-banner/route.tsdeleted file mode 100644index 5a89908ae34..00000000000--- a/apps/studio/app/api/incident-banner/route.ts+++ /dev/null@@ -1,63 +0,0 @@-import { IS_PLATFORM } from 'common'-import { NextResponse } from 'next/server'--import { InternalServerError } from '@/lib/api/apiHelpers'-import { getBannerIncidents } from '@/lib/api/incident-banner'--/**- * Cache on CDN for 5 minutes- * Allow serving stale content for 1 minute while revalidating- */-const CACHE_CONTROL_SETTINGS = 'public, s-maxage=300, stale-while-revalidate=60'--export async function OPTIONS() {- if (!IS_PLATFORM) return new Response(null, { status: 404 })- return new Response(null, {- status: 204,- headers: {- Allow: 'GET, HEAD, OPTIONS',- },- })-}--export async function HEAD() {- if (!IS_PLATFORM) return new Response(null, { status: 404 })- return new Response(null, {- status: 200,- headers: { 'Cache-Control': CACHE_CONTROL_SETTINGS },- })-}--export async function GET() {- if (!IS_PLATFORM) return new Response(null, { status: 404 })-- try {- const incidents = await getBannerIncidents()- return NextResponse.json(- { incidents },- { headers: { 'Cache-Control': CACHE_CONTROL_SETTINGS } }- )- } catch (error) {- let errorCode = 500- const headers = new Headers()-- if (error instanceof InternalServerError) {- if (typeof error.details?.status === 'number') errorCode = error.details.status- if (errorCode === 420) errorCode = 429- if (errorCode === 429 && typeof error.details?.retryAfter === 'string') {- headers.set('Retry-After', error.details.retryAfter)- }- console.error('Failed to fetch incident.io incidents: %O', {- message: error.message,- details: error.details,- })- } else {- console.error('Unexpected error fetching incident.io incidents: %O', error)- }-- return NextResponse.json(- { error: { message: 'Internal server error' } },- { status: errorCode, headers }- )- }-}diff --git a/apps/studio/app/api/incident-status/route.ts b/apps/studio/app/api/incident-status/route.tsdeleted file mode 100644index 456806054a9..00000000000--- a/apps/studio/app/api/incident-status/route.ts+++ /dev/null@@ -1,108 +0,0 @@-import { IS_PLATFORM } from 'common'-import { NextResponse } from 'next/server'--import { InternalServerError } from '@/lib/api/apiHelpers'-import { getActiveIncidents, type IncidentCache } from '@/lib/api/incident-status'-import { createAdminClient } from '@/lib/api/supabase-admin'--/**- * Cache on CDN for 5 minutes- * Allow serving stale content for 1 minute while revalidating- */-const CACHE_CONTROL_SETTINGS = 'public, s-maxage=300, stale-while-revalidate=60'--async function fetchIncidentCache(incidentIds: Array<string>): Promise<Map<string, IncidentCache>> {- const cacheMap = new Map<string, IncidentCache>()-- if (incidentIds.length === 0) return cacheMap-- const supabase = createAdminClient()-- try {- const { data, error } = await supabase- .from('incident_status_cache')- .select('incident_id, affected_regions, affects_project_creation')- .in('incident_id', incidentIds)-- if (error) {- console.error('Failed to fetch incident_status_cache: %O', error)- return cacheMap- }-- for (const row of data ?? []) {- cacheMap.set(row.incident_id, {- affected_regions: row.affected_regions ?? null,- affects_project_creation: row.affects_project_creation,- })- }- } catch (error) {- console.error('Unexpected error fetching incident_status_cache: %O', error)- }-- return cacheMap-}--export async function OPTIONS() {- if (!IS_PLATFORM) return new Response(null, { status: 404 })- return new Response(null, {- status: 204,- headers: {- Allow: 'GET, HEAD, OPTIONS',- },- })-}--export async function HEAD() {- if (!IS_PLATFORM) return new Response(null, { status: 404 })- return new Response(null, {- status: 200,- headers: { 'Cache-Control': CACHE_CONTROL_SETTINGS },- })-}--export async function GET() {- if (!IS_PLATFORM) return new Response(null, { status: 404 })-- try {- const allIncidents = await getActiveIncidents()-- const bannerIncidents = allIncidents.filter(- (incident) =>- incident.impact !== 'maintenance' &&- incident.metadata?.dashboard_metadata?.show_banner === true- )-- const cacheMap = await fetchIncidentCache(bannerIncidents.map((i) => i.id))-- const enrichedIncidents = bannerIncidents.map((incident) => ({- ...incident,- cache: cacheMap.get(incident.id) ?? null,- }))-- return NextResponse.json(enrichedIncidents, {- headers: { 'Cache-Control': CACHE_CONTROL_SETTINGS },- })- } catch (error) {- let errorCode = 500- const headers = new Headers()-- if (error instanceof InternalServerError) {- if (typeof error.details?.status === 'number') errorCode = error.details.status- if (errorCode === 420) errorCode = 429- if (errorCode === 429 && typeof error.details?.retryAfter === 'string') {- headers.set('Retry-After', error.details.retryAfter)- }- console.error('Failed to fetch active StatusPage incidents: %O', {- message: error.message,- details: error.details,- })- } else {- console.error('Unexpected error fetching active StatusPage incidents: %O', error)- }-- return NextResponse.json(- { error: 'Unable to fetch incidents at this time' },- { status: errorCode, headers }- )- }-}diff --git a/apps/studio/components/interfaces/App/AppBannerWrapper.tsx b/apps/studio/components/interfaces/App/AppBannerWrapper.tsxindex 5185f28c35e..f63a30eab6b 100644--- a/apps/studio/components/interfaces/App/AppBannerWrapper.tsx+++ b/apps/studio/components/interfaces/App/AppBannerWrapper.tsx@@ -8,7 +8,6 @@ import { isLogsOrObservabilityPath, isOrganizationLandingPath } from './AppBanneimport { ClockSkewBanner } from '@/components/layouts/AppLayout/ClockSkewBanner'import { NoticeBanner } from '@/components/layouts/AppLayout/NoticeBanner'import { StatusBanner } from '@/components/layouts/AppLayout/StatusBanner'-import { StatusPageBanner } from '@/components/layouts/AppLayout/StatusPageBanner'import { BannerLogsAllDeprecation } from '@/components/ui/BannerStack/Banners/BannerLogsAllDeprecation'import { BannerTermsOfServiceUpdate } from '@/components/ui/BannerStack/Banners/BannerTermsOfServiceUpdate'import { BANNER_ID, useBannerStack } from '@/components/ui/BannerStack/BannerStackProvider'@@ -28,7 +27,6 @@ export const AppBannerWrapper = ({}: PropsWithChildren<{ signedOut?: boolean }>) => {const showNoticeBanner = useFlag('showNoticeBanner')const clockSkewBanner = useFlag('clockSkewBanner')- const useStatusPageWidget = useFlag('incidentIoStatusPage')const { addBanner, dismissBanner } = useBannerStack()const pathname = usePathname()@@ -118,7 +116,7 @@ export const AppBannerWrapper = ({return (<div className="flex flex-col"><div className="shrink-0">- {useStatusPageWidget ? <StatusBanner signedOut={signedOut} /> : <StatusPageBanner />}+ <StatusBanner signedOut={signedOut} />{showNoticeBanner && <NoticeBanner />}<OrganizationResourceBanner />{clockSkewBanner && <ClockSkewBanner />}diff --git a/apps/studio/components/interfaces/ProjectCreation/RegionSelector.tsx b/apps/studio/components/interfaces/ProjectCreation/RegionSelector.tsxindex 70cb905dc33..42df1981f74 100644--- a/apps/studio/components/interfaces/ProjectCreation/RegionSelector.tsx+++ b/apps/studio/components/interfaces/ProjectCreation/RegionSelector.tsx@@ -1,4 +1,4 @@-import { useFeatureFlags, useFlag, useParams } from 'common'+import { useFeatureFlags, useParams } from 'common'import { Loader2Icon } from 'lucide-react'import { useEffect, useRef, useState } from 'react'import { UseFormReturn } from 'react-hook-form'@@ -31,11 +31,7 @@ import {getHighAvailabilityRegionCode,} from './ProjectCreation.utils'import { ProjectCreationStatusAdmonition } from './ProjectCreationStatusAdmonition'-import {- getRegionRestrictionCopy,- regionMatches,- SELECT_DIFFERENT_REGION,-} from './RegionSelector.utils'+import { getRegionRestrictionCopy, SELECT_DIFFERENT_REGION } from './RegionSelector.utils'import { useRegionRestriction } from './useRegionRestriction'import { AlertError } from '@/components/ui/AlertError'import { InlineLink, InlineLinkClassName } from '@/components/ui/InlineLink'@@ -43,7 +39,6 @@ import Panel from '@/components/ui/Panel'import { RegionFlag } from '@/components/ui/RegionFlag'import { useDefaultRegionQuery } from '@/data/misc/get-default-region-query'import { useOrganizationAvailableRegionsQuery } from '@/data/organizations/organization-available-regions-query'-import { useIncidentStatusQuery } from '@/data/platform/incident-status-query'import type { DesiredInstanceSize } from '@/data/projects/new-project.constants'import { DOCS_URL } from '@/lib/constants'import { useTrack } from '@/lib/telemetry/track'@@ -93,14 +88,10 @@ export const RegionSelector = ({const { hasLoaded: flagsLoaded } = useFeatureFlags()const smartRegionEnabled = cloudProvider !== 'AWS_NIMBUS'- const isStatusPageEnabled = useFlag('incidentIoStatusPage') === trueconst isSpecificRegionsLinkEnabled = isFreePlan && !hideSpecificRegionsconst { getRegionRestriction } = useRegionRestriction()- const { data: statusData } = useIncidentStatusQuery({ enabled: !isStatusPageEnabled })- const { incidents = [] } = statusData ?? {}-const { isPending: isLoadingDefaultRegion } = useDefaultRegionQuery({ cloudProvider },{ enabled: flagsLoaded && !smartRegionEnabled }@@ -229,15 +220,6 @@ export const RegionSelector = ({: undefinedconst triggerLabel = isLoading ? 'Loading available regions...' : selectedRegionLabel- const affectingIncidents = incidents.filter((incident) => {- const affectedRegions = incident.cache?.affected_regions ?? []- if (affectedRegions.length === 0 || selectedRegion?.code === undefined) return false-- return affectedRegions.some((affectedRegion) =>- regionMatches(selectedRegion.code, affectedRegion)- )- })-return (<><FormItemLayout@@ -431,29 +413,7 @@ export const RegionSelector = ({</div></FormItemLayout>- {isStatusPageEnabled ? (- <ProjectCreationStatusAdmonition selectedRegionCode={selectedRegion?.code} />- ) : (- affectingIncidents.length > 0 && (- <FormItemLayout layout="horizontal">- <Admonition- type="warning"- title="Incident in progress for this region"- description={- <>- We're currently investigating an issue that may impact projects in this- region. Follow updates on{' '}- <InlineLink href="https://status.supabase.com">- status.supabase.com- </InlineLink>- .- </>- }- className="mt-3"- />- </FormItemLayout>- )- )}+ <ProjectCreationStatusAdmonition selectedRegionCode={selectedRegion?.code} />{selectedRestrictionCopy !== undefined && (<FormItemLayout layout="horizontal" isReactForm={false}>diff --git a/apps/studio/components/interfaces/Support/__tests__/SupportFormPage.test.tsx b/apps/studio/components/interfaces/Support/__tests__/SupportFormPage.test.tsxindex 0894961cffd..f932d1f994d 100644--- a/apps/studio/components/interfaces/Support/__tests__/SupportFormPage.test.tsx+++ b/apps/studio/components/interfaces/Support/__tests__/SupportFormPage.test.tsx@@ -143,10 +143,6 @@ const { mockCommitSha, mockCommitTime, mockUseDeploymentCommitQuery } = vi.hoistconst mockStudioVersion = `SHA ${mockCommitSha} deployed at ${dayjs(mockCommitTime).format('YYYY-MM-DD HH:mm:ss Z')}`-const { mockUseFlag } = vi.hoisted(() => ({- mockUseFlag: vi.fn().mockReturnValue(false),-}))-vi.mock('react-inlinesvg', () => ({__esModule: true,default: () => null,@@ -195,7 +191,7 @@ vi.mock(import('common'), async (importOriginal) => {...actual,useParams: vi.fn().mockReturnValue({ ref: 'default' }),useIsLoggedIn: vi.fn().mockReturnValue(true),- useFlag: mockUseFlag,+ useFlag: vi.fn().mockReturnValue(false),isFeatureEnabled: vi.fn((feature: any, disabledFeatures: any) => {if (typeof feature === 'string') {if (feature === 'support:show_client_libraries') {@@ -398,7 +394,6 @@ describe('SupportFormPage', () => {})beforeEach(async () => {- mockUseFlag.mockReset().mockReturnValue(false)mockUseDeploymentCommitQuery.mockReturnValue({data: { commitSha: mockCommitSha, commitTime: mockCommitTime },})@@ -500,7 +495,15 @@ describe('SupportFormPage', () => {})mswServer.use(- http.get(`${BASE_PATH}/api/incident-status`, () => HttpResponse.json([], { status: 200 }))+ http.get(`${BASE_PATH}/api/status-page`, () =>+ HttpResponse.json<StatusPageResponse>({+ page_title: 'Supabase status',+ page_url: 'https://status.supabase.com/',+ ongoing_incidents: [],+ in_progress_maintenances: [],+ scheduled_maintenances: [],+ })+ ))addAPIMock({@@ -558,34 +561,9 @@ describe('SupportFormPage', () => {})})- test('shows system status: not healthy', async () => {- mswServer.use(- http.get(`${BASE_PATH}/api/incident-status`, () =>- HttpResponse.json(- [- {- id: 'z3qp8rln72pl',- active_since: '2026-01-26T10:30:00Z',- impact: 'critical',- status: 'in_progress',- name: 'Test incident',- },- ],- { status: 200 }- )- )- )-- renderSupportFormStatusButton()-- await waitFor(() => {- expect(getStatusLink(screen)).toHaveTextContent('Active incident ongoing')- })- })-test('shows system status: check failed', async () => {mswServer.use(- http.get(`${BASE_PATH}/api/incident-status`, () =>+ http.get(`${BASE_PATH}/api/status-page`, () =>HttpResponse.json({ msg: 'Status service unavailable' }, { status: 500 })))@@ -597,9 +575,7 @@ describe('SupportFormPage', () => {})})- test('flag on: shows an active incident from the new status page endpoint', async () => {- mockUseFlag.mockImplementation((name: string) => name === 'incidentIoStatusPage')-+ test('shows system status: not healthy', async () => {mswServer.use(http.get(`${BASE_PATH}/api/status-page`, () =>HttpResponse.json<StatusPageResponse>({diff --git a/apps/studio/components/interfaces/Support/useSupportStatus.ts b/apps/studio/components/interfaces/Support/useSupportStatus.tsindex 43d18b7ad6b..3e586594d1e 100644--- a/apps/studio/components/interfaces/Support/useSupportStatus.ts+++ b/apps/studio/components/interfaces/Support/useSupportStatus.ts@@ -1,82 +1,33 @@import { useQuery } from '@tanstack/react-query'-import { useFlag } from 'common'import {- DEFAULT_STATUS_PAGE_URL,- getStatusDescription,getStatusPillLabel,getSupportAdmonitionCopy,prioritizeActiveItems,type SupportStatus,} from './SupportStatus.utils'-import { useIncidentStatusQuery } from '@/data/platform/incident-status-query'-import { processIncidentData } from '@/data/platform/incident-status-utils'import { statusPageQueryOptions } from '@/data/platform/status-page-query'import { IS_PLATFORM } from '@/lib/constants'import { normalizeStatusPage } from '@/lib/status-page/status-page.utils'-function getLegacyPillLabel(hasActiveIncidents: boolean, isMaintenance: boolean): string {- if (hasActiveIncidents) return 'Active incident ongoing'- if (isMaintenance) return 'Scheduled maintenance'- return 'All systems operational'-}-export function useSupportStatus(): SupportStatus {- const useNewStatusPage = useFlag('incidentIoStatusPage') === true-- const newStatusQuery = useQuery({+ const statusQuery = useQuery({...statusPageQueryOptions(),select: normalizeStatusPage,- enabled: useNewStatusPage && IS_PLATFORM,+ enabled: IS_PLATFORM,})- const legacyQuery = useIncidentStatusQuery({ enabled: !useNewStatusPage })-- if (useNewStatusPage) {- if (newStatusQuery.isPending) return { status: 'pending' }- if (newStatusQuery.isError) return { status: 'error' }-- const { pageUrl, items } = newStatusQuery.data- const activeItems = prioritizeActiveItems(items)-- return {- status: 'success',- hasActiveIncidents: activeItems.some((item) => item.kind === 'incident'),- pillLabel: getStatusPillLabel(items),- admonition: getSupportAdmonitionCopy(items),- pageUrl,- }- }-- if (legacyQuery.isPending) return { status: 'pending' }- if (legacyQuery.isError) return { status: 'error' }-- const { incidents = [], maintenanceEvents = [] } = legacyQuery.data ?? {}- const hasActiveIncidents = incidents.length > 0- const isMaintenance = maintenanceEvents.length > 0- const { hasMultipleIncidents, mostCriticalIncident, overallStatus, allSameStatus } =- processIncidentData(incidents)+ if (statusQuery.isPending) return { status: 'pending' }+ if (statusQuery.isError) return { status: 'error' }- const admonitionTitle =- (mostCriticalIncident?.name ?? '') +- (hasMultipleIncidents- ? ` and ${incidents.length - 1} other issue${incidents.length > 2 ? 's' : ''}`- : '')+ const { pageUrl, items } = statusQuery.data+ const activeItems = prioritizeActiveItems(items)return {status: 'success',- hasActiveIncidents,- pillLabel: getLegacyPillLabel(hasActiveIncidents, isMaintenance),- admonition: hasActiveIncidents- ? {- title: admonitionTitle,- description: getStatusDescription({- status: overallStatus,- hasMultipleIncidents,- allSameStatus,- }),- }- : null,- pageUrl: DEFAULT_STATUS_PAGE_URL,+ hasActiveIncidents: activeItems.some((item) => item.kind === 'incident'),+ pillLabel: getStatusPillLabel(items),+ admonition: getSupportAdmonitionCopy(items),+ pageUrl,}}diff --git a/apps/studio/components/layouts/AppLayout/StatusBanner.tsx b/apps/studio/components/layouts/AppLayout/StatusBanner.tsxindex e62036090e8..3501400e9e6 100644--- a/apps/studio/components/layouts/AppLayout/StatusBanner.tsx+++ b/apps/studio/components/layouts/AppLayout/StatusBanner.tsx@@ -72,7 +72,6 @@ function getBannerDescription({/*** Global banner for incident.io status page items — a relevant active incident,* in-progress maintenance, or upcoming maintenance, in that priority order.- * Replaces the legacy StatusPageBanner while `incidentIoStatusPage` is on.*/export const StatusBanner = ({ signedOut = false }: { signedOut?: boolean } = {}) => {const state = useStatusBanner({ signedOut })diff --git a/apps/studio/components/layouts/AppLayout/StatusPageBanner.tsx b/apps/studio/components/layouts/AppLayout/StatusPageBanner.tsxdeleted file mode 100644index c278562eb1a..00000000000--- a/apps/studio/components/layouts/AppLayout/StatusPageBanner.tsx+++ /dev/null@@ -1,27 +0,0 @@-import { useStatusPageBannerVisibility } from './useStatusPageBannerVisibility'-import { HeaderBanner } from '@/components/interfaces/Organization/HeaderBanner'-import { InlineLink } from '@/components/ui/InlineLink'--const BANNER_DESCRIPTION = (- <>- Follow the <InlineLink href="https://status.supabase.com">status page</InlineLink> for updates- </>-)--/**- * Used to display ongoing incidents- */-export const StatusPageBanner = () => {- const banner = useStatusPageBannerVisibility()-- if (!banner) return null-- return (- <HeaderBanner- variant="warning"- title={banner.title}- description={BANNER_DESCRIPTION}- onDismiss={banner.dismiss}- />- )-}diff --git a/apps/studio/components/layouts/AppLayout/StatusPageBanner.utils.test.ts b/apps/studio/components/layouts/AppLayout/StatusPageBanner.utils.test.tsdeleted file mode 100644index d6c1eea2f95..00000000000--- a/apps/studio/components/layouts/AppLayout/StatusPageBanner.utils.test.ts+++ /dev/null@@ -1,407 +0,0 @@-import { describe, expect, it } from 'vitest'--import { getRelevantIncidentIds, shouldShowBanner } from './StatusPageBanner.utils'--const noCache = { id: 'no-cache', cache: null } as const-const noRestrictions = {- id: 'no-restrictions',- cache: { affected_regions: null, affects_project_creation: false },-}-const affectsCreation = {- id: 'affects-creation',- cache: { affected_regions: null, affects_project_creation: true },-}-const usEast1Only = {- id: 'us-east-1-only',- cache: { affected_regions: ['us-east-1'], affects_project_creation: false },-}-const usEast1AndCreation = {- id: 'us-east-1-and-creation',- cache: { affected_regions: ['us-east-1'], affects_project_creation: true },-}-const forced = {- id: 'forced',- cache: { affected_regions: ['us-east-1'], affects_project_creation: false, force: true },-}--describe('shouldShowBanner', () => {- describe('no incidents', () => {- it('does not show when there are no incidents', () => {- expect(- shouldShowBanner({ incidents: [], hasProjects: true, userRegions: new Set(['us-east-1']) })- ).toBe(false)- })- })-- describe('user has no projects', () => {- it('does not show when cache is absent', () => {- expect(- shouldShowBanner({ incidents: [noCache], hasProjects: false, userRegions: new Set() })- ).toBe(false)- })-- it('does not show when affects_project_creation is false', () => {- expect(- shouldShowBanner({- incidents: [noRestrictions],- hasProjects: false,- userRegions: new Set(),- })- ).toBe(false)- })-- it('shows when affects_project_creation is true and no region restriction', () => {- expect(- shouldShowBanner({- incidents: [affectsCreation],- hasProjects: false,- userRegions: new Set(),- })- ).toBe(true)- })-- it('does not show when affects_project_creation is true but there is a region restriction', () => {- expect(- shouldShowBanner({- incidents: [usEast1AndCreation],- hasProjects: false,- userRegions: new Set(),- })- ).toBe(false)- })- })-- describe('user has projects, no region restriction', () => {- it('shows when cache is absent', () => {- expect(- shouldShowBanner({- incidents: [noCache],- hasProjects: true,- userRegions: new Set(['us-east-1']),- })- ).toBe(true)- })-- it('shows when affected_regions is null', () => {- expect(- shouldShowBanner({- incidents: [noRestrictions],- hasProjects: true,- userRegions: new Set(['us-east-1']),- })- ).toBe(true)- })-- it('shows when affected_regions is an empty array', () => {- expect(- shouldShowBanner({- incidents: [- { id: 'test', cache: { affected_regions: [], affects_project_creation: false } },- ],- hasProjects: true,- userRegions: new Set(['us-east-1']),- })- ).toBe(true)- })- })-- describe('user has projects, with region restriction', () => {- it('shows when user has a primary database in an affected region', () => {- expect(- shouldShowBanner({- incidents: [usEast1Only],- hasProjects: true,- userRegions: new Set(['us-east-1']),- })- ).toBe(true)- })-- it('shows when user has a read replica in an affected region', () => {- expect(- shouldShowBanner({- incidents: [- {- id: 'test',- cache: { affected_regions: ['eu-west-1'], affects_project_creation: false },- },- ],- hasProjects: true,- userRegions: new Set(['us-east-1', 'eu-west-1']),- })- ).toBe(true)- })-- it('shows when one of multiple affected regions matches', () => {- expect(- shouldShowBanner({- incidents: [- {- id: 'test',- cache: {- affected_regions: ['us-east-1', 'ap-southeast-1'],- affects_project_creation: false,- },- },- ],- hasProjects: true,- userRegions: new Set(['ap-southeast-1']),- })- ).toBe(true)- })-- it('shows when affected region has inconsistent casing (AI-generated cache)', () => {- expect(- shouldShowBanner({- incidents: [- {- id: 'test',- cache: { affected_regions: ['US-East-1'], affects_project_creation: false },- },- ],- hasProjects: true,- userRegions: new Set(['us-east-1']),- })- ).toBe(true)- })-- it('does not show when user has no databases in any affected region', () => {- expect(- shouldShowBanner({- incidents: [usEast1Only],- hasProjects: true,- userRegions: new Set(['eu-west-1', 'ap-southeast-1']),- })- ).toBe(false)- })-- it('does not show when user has projects but no databases in affected region, even with affects_project_creation', () => {- expect(- shouldShowBanner({- incidents: [usEast1AndCreation],- hasProjects: true,- userRegions: new Set(['eu-west-1']),- })- ).toBe(false)- })- })-- describe('multiple incidents', () => {- it('shows when at least one incident matches even if others do not', () => {- expect(- shouldShowBanner({- incidents: [usEast1Only, noRestrictions],- hasProjects: true,- userRegions: new Set(['eu-west-1']),- })- ).toBe(true)- })-- it('does not show when no incident matches', () => {- expect(- shouldShowBanner({- incidents: [usEast1Only, usEast1AndCreation],- hasProjects: true,- userRegions: new Set(['eu-west-1']),- })- ).toBe(false)- })-- it('shows when any incident matches for a no-project user via affects_project_creation', () => {- expect(- shouldShowBanner({- incidents: [usEast1Only, affectsCreation],- hasProjects: false,- userRegions: new Set(),- })- ).toBe(true)- })- })-- describe('force', () => {- it('shows for a user with no projects regardless of affects_project_creation', () => {- expect(- shouldShowBanner({ incidents: [forced], hasProjects: false, userRegions: new Set() })- ).toBe(true)- })-- it('shows for a user whose regions do not overlap with affected_regions', () => {- expect(- shouldShowBanner({- incidents: [forced],- hasProjects: true,- userRegions: new Set(['eu-west-1']),- })- ).toBe(true)- })-- it('shows for a user with projects and no regions at all', () => {- expect(- shouldShowBanner({ incidents: [forced], hasProjects: true, userRegions: new Set() })- ).toBe(true)- })-- it('shows even when mixed with non-matching non-forced incidents', () => {- expect(- shouldShowBanner({- incidents: [usEast1Only, forced],- hasProjects: false,- userRegions: new Set(),- })- ).toBe(true)- })- })-- describe('hasUnknownRegions', () => {- it('shows when regions are unknown and incident has a region restriction', () => {- expect(- shouldShowBanner({- incidents: [usEast1Only],- hasProjects: true,- userRegions: new Set(),- hasUnknownRegions: true,- })- ).toBe(true)- })-- it('still applies no-projects check even when regions are unknown', () => {- expect(- shouldShowBanner({- incidents: [usEast1Only],- hasProjects: false,- userRegions: new Set(),- hasUnknownRegions: true,- })- ).toBe(false)- })-- it('does not show for affects_project_creation with no projects when there is a region restriction, even when regions are unknown', () => {- expect(- shouldShowBanner({- incidents: [usEast1AndCreation],- hasProjects: false,- userRegions: new Set(),- hasUnknownRegions: true,- })- ).toBe(false)- })- })-})--describe('getRelevantIncidentIds', () => {- it('returns empty array when there are no incidents', () => {- expect(- getRelevantIncidentIds({ incidents: [], hasProjects: true, userRegions: new Set() })- ).toEqual([])- })-- it('returns empty array when no incidents are relevant to the user', () => {- expect(- getRelevantIncidentIds({- incidents: [usEast1Only],- hasProjects: true,- userRegions: new Set(['eu-west-1']),- })- ).toEqual([])- })-- it('returns the ID of a single relevant incident', () => {- expect(- getRelevantIncidentIds({- incidents: [noRestrictions],- hasProjects: true,- userRegions: new Set(['us-east-1']),- })- ).toEqual(['no-restrictions'])- })-- it('returns IDs of all relevant incidents', () => {- const euWest1Only = {- id: 'eu-west-1-only',- cache: { affected_regions: ['eu-west-1'], affects_project_creation: false },- }- const apSoutheast1Only = {- id: 'ap-southeast-1-only',- cache: { affected_regions: ['ap-southeast-1'], affects_project_creation: false },- }-- expect(- getRelevantIncidentIds({- incidents: [euWest1Only, apSoutheast1Only],- hasProjects: true,- userRegions: new Set(['eu-west-1', 'ap-southeast-1']),- })- ).toEqual(expect.arrayContaining(['ap-southeast-1-only', 'eu-west-1-only']))- })-- it('returns the ID of a relevant incident when affected_regions has inconsistent casing', () => {- expect(- getRelevantIncidentIds({- incidents: [- {- id: 'mixed-case-region',- cache: { affected_regions: ['US-East-1'], affects_project_creation: false },- },- ],- hasProjects: true,- userRegions: new Set(['us-east-1']),- })- ).toEqual(['mixed-case-region'])- })-- it('excludes incidents irrelevant to the user from the result', () => {- // User is in eu-west-1; us-east-1-only incident should not be included- expect(- getRelevantIncidentIds({- incidents: [usEast1Only, noRestrictions],- hasProjects: true,- userRegions: new Set(['eu-west-1']),- })- ).toEqual(['no-restrictions'])- })-- describe('user has no projects', () => {- it('includes incidents with affects_project_creation', () => {- expect(- getRelevantIncidentIds({- incidents: [affectsCreation],- hasProjects: false,- userRegions: new Set(),- })- ).toEqual(['affects-creation'])- })-- it('excludes incidents without affects_project_creation', () => {- expect(- getRelevantIncidentIds({- incidents: [noRestrictions, usEast1Only],- hasProjects: false,- userRegions: new Set(),- })- ).toEqual([])- })- })-- describe('hasUnknownRegions', () => {- it('includes region-restricted incidents when regions are unknown', () => {- expect(- getRelevantIncidentIds({- incidents: [usEast1Only],- hasProjects: true,- userRegions: new Set(),- hasUnknownRegions: true,- })- ).toEqual(['us-east-1-only'])- })-- it('still excludes incidents for no-project users even when regions are unknown', () => {- expect(- getRelevantIncidentIds({- incidents: [usEast1Only],- hasProjects: false,- userRegions: new Set(),- hasUnknownRegions: true,- })- ).toEqual([])- })- })-})diff --git a/apps/studio/components/layouts/AppLayout/StatusPageBanner.utils.ts b/apps/studio/components/layouts/AppLayout/StatusPageBanner.utils.tsdeleted file mode 100644index 79bb1f9a86c..00000000000--- a/apps/studio/components/layouts/AppLayout/StatusPageBanner.utils.ts+++ /dev/null@@ -1,75 +0,0 @@-import type { IncidentCache } from '@/lib/api/incident-status'-import { normalizeRegion } from '@/lib/status-page/status-page.utils'--type BannerIncident = { id: string; cache?: IncidentCache | null }--/**- * Determines whether the incident status banner should be shown to a given user,- * given all active incidents and the user's project state.- *- * Returns true if any incident matches the user's context.- *- * @param incidents - Active incidents from the incident-status endpoint- * @param hasProjects - Whether the user has any projects at all- * @param userRegions - Deduplicated set of regions of all databases (primary and read replicas)- * owned by the user, normalized via normalizeRegion- * @param hasUnknownRegions - True when region data is incomplete (an org has more than 100- * projects, or an org's projects failed to load). When true, the region check is skipped and- * a match is assumed.- */-export function shouldShowBanner({- incidents,- hasProjects,- userRegions,- hasUnknownRegions = false,-}: {- incidents: Array<BannerIncident>- hasProjects: boolean- userRegions: ReadonlySet<string>- hasUnknownRegions?: boolean-}): boolean {- return incidents.some((incident) => {- // Forced incidents are shown unconditionally, regardless of regions or project state- if (incident.cache?.force) return true-- const affectedRegions = incident.cache?.affected_regions ?? []- const affectsProjectCreation = incident.cache?.affects_project_creation ?? false-- // Users with no projects only see the banner if the incident affects project creation- // and has no specific region targeting (inline notice in RegionSelector handles region-specific incidents)- if (!hasProjects) return affectsProjectCreation && affectedRegions.length === 0-- // User has projects: if no region restriction, always show- if (affectedRegions.length === 0) return true-- // Region data is incomplete — assume the user has a database in an affected region- if (hasUnknownRegions) return true-- // Region restriction: only show if the user has a database in an affected region- return affectedRegions.some((region) => userRegions.has(normalizeRegion(region)))- })-}--/**- * Returns the IDs of incidents that are relevant to the given user.- *- * An incident is considered relevant if it would trigger banner visibility for- * the user, per the same logic as shouldShowBanner.- */-export function getRelevantIncidentIds({- incidents,- hasProjects,- userRegions,- hasUnknownRegions = false,-}: {- incidents: Array<BannerIncident>- hasProjects: boolean- userRegions: ReadonlySet<string>- hasUnknownRegions?: boolean-}): Array<string> {- return incidents- .filter((incident) =>- shouldShowBanner({ incidents: [incident], hasProjects, userRegions, hasUnknownRegions })- )- .map((incident) => incident.id)-}diff --git a/apps/studio/components/layouts/AppLayout/useStatusPageBannerVisibility.ts b/apps/studio/components/layouts/AppLayout/useStatusPageBannerVisibility.tsdeleted file mode 100644index 61c59eb584e..00000000000--- a/apps/studio/components/layouts/AppLayout/useStatusPageBannerVisibility.ts+++ /dev/null@@ -1,74 +0,0 @@-import { useQuery } from '@tanstack/react-query'-import { LOCAL_STORAGE_KEYS } from 'common'-import { useCallback } from 'react'--import { getRelevantIncidentIds, shouldShowBanner } from './StatusPageBanner.utils'-import { incidentBannerQueryOptions } from '@/data/platform/incident-banner-query'-import { useEmergencyIncidentOverride } from '@/hooks/misc/useEmergencyIncidentOverride'-import { useLocalStorageQuery } from '@/hooks/misc/useLocalStorage'-import { useUserProjectRegions } from '@/hooks/misc/useUserProjectRegions'--export type StatusPageBannerData = { title: string; dismiss?: () => void }--const EMPTY_REGIONS: ReadonlySet<string> = new Set()--export function useStatusPageBannerVisibility(): StatusPageBannerData | null {- const showIncidentBannerOverride = useEmergencyIncidentOverride()-- const { data: incidentBannerData } = useQuery(incidentBannerQueryOptions())-- const bannerItems = incidentBannerData?.incidents ?? []- const incidents = bannerItems.map((i) => ({ id: i.id, cache: i.metadata }))- const hasActiveIncidents = incidents.length > 0-- const userProjectRegions = useUserProjectRegions({- enabled: !showIncidentBannerOverride && hasActiveIncidents,- })-- const userContext =- userProjectRegions.status === 'resolved' ? userProjectRegions.context : undefined- const hasProjects = userContext?.hasProjects ?? false- const userRegions = userContext?.regions ?? EMPTY_REGIONS- const hasUnknownRegions = userContext !== undefined && !userContext.isComplete-- const [dismissedIds, setDismissedIds, { isSuccess: isDismissedLoaded }] = useLocalStorageQuery<- Array<string>- >(LOCAL_STORAGE_KEYS.INCIDENT_BANNER_DISMISSED_IDS, [])-- const dismiss = useCallback(() => {- const activeIncidentIds = new Set(incidents.map((i) => i.id))- const relevantIds = getRelevantIncidentIds({- incidents,- hasProjects,- userRegions,- hasUnknownRegions,- })- setDismissedIds((prev) => [- ...new Set([...prev.filter((id) => activeIncidentIds.has(id)), ...relevantIds]),- ])- }, [incidents, hasProjects, userRegions, hasUnknownRegions, setDismissedIds])-- if (showIncidentBannerOverride) return { title: 'We are investigating a technical issue' }-- if (!hasActiveIncidents || userProjectRegions.status === 'loading') return null-- const dismissedIdSet = new Set(dismissedIds)- const undismissedIncidents = incidents.filter((i) => !dismissedIdSet.has(i.id))-- if (- !isDismissedLoaded ||- !shouldShowBanner({- incidents: undismissedIncidents,- hasProjects,- userRegions,- hasUnknownRegions,- })- )- return null-- const title = hasProjects- ? 'We are investigating a technical issue'- : 'Project creation may be impacted in some regions'-- return { title, dismiss }-}diff --git a/apps/studio/data/platform/incident-banner-query.ts b/apps/studio/data/platform/incident-banner-query.tsdeleted file mode 100644index 2b9fa3f8b51..00000000000--- a/apps/studio/data/platform/incident-banner-query.ts+++ /dev/null@@ -1,41 +0,0 @@-import { queryOptions } from '@tanstack/react-query'-import { IS_PLATFORM } from 'common'--import { platformKeys } from './keys'-import { BASE_PATH } from '@/lib/constants'--export interface IncidentBannerItem {- id: string- show_banner: true | 'force'- metadata: {- affected_regions: Array<string> | null- affects_project_creation: boolean- force: boolean- }-}--export type IncidentBannerData = { incidents: Array<IncidentBannerItem> }-export type IncidentBannerError = unknown--async function getIncidentBanner(signal?: AbortSignal): Promise<IncidentBannerData> {- const response = await fetch(`${BASE_PATH}/api/incident-banner`, {- signal,- method: 'GET',- credentials: 'omit',- headers: { 'Content-Type': 'application/json' },- })- if (!response.ok) throw new Error(`Failed to fetch incident banner: ${response.statusText}`)- return response.json()-}--export const incidentBannerQueryOptions = () =>- queryOptions({- queryKey: platformKeys.incidentBanner(),- queryFn: ({ signal }) => getIncidentBanner(signal),- refetchOnWindowFocus: false,- // exponential backoff retry starting at 4s, 16s, 64s, 256s etc. Hard capped at 5 minutes to prevent excessively- // long retry delays.- retryDelay: (attemptIndex) => Math.min(1000 * 4 ** attemptIndex, 1000 * 60 * 5),- staleTime: 1000 * 60 * 5,- enabled: IS_PLATFORM,- })diff --git a/apps/studio/data/platform/incident-status-query.ts b/apps/studio/data/platform/incident-status-query.tsdeleted file mode 100644index 42c6c627259..00000000000--- a/apps/studio/data/platform/incident-status-query.ts+++ /dev/null@@ -1,70 +0,0 @@-import { useQuery } from '@tanstack/react-query'-import { partition } from 'lodash'--import { platformKeys } from './keys'-import type { IncidentInfo } from '@/lib/api/incident-status'-import { BASE_PATH, IS_PLATFORM, IS_TEST_ENV } from '@/lib/constants'-import { ResponseError, UseCustomQueryOptions } from '@/types'--export async function getIncidentStatus(- signal?: AbortSignal-): Promise<{ maintenanceEvents: IncidentInfo[]; incidents: IncidentInfo[] }> {- const response = await fetch(`${BASE_PATH}/api/incident-status`, {- signal,- method: 'GET',- credentials: 'omit',- headers: {- 'Content-Type': 'application/json',- },- })-- if (!response.ok) {- const errorText = await response.text()- console.error('[getIncidentStatus] Failed:', response.status, errorText)-- let retryAfter: number | undefined- const retryAfterHeader = response.headers.get('Retry-After')- if (retryAfterHeader !== null) {- const parsed = Number(retryAfterHeader)- if (Number.isFinite(parsed) && parsed > 0) retryAfter = parsed- }-- throw new ResponseError(- `Failed to fetch incident status: ${response.statusText}`,- response.status,- undefined,- retryAfter- )- }-- const data = await response.json()- const [maintenanceEvents, incidents] = partition(- data ?? [],- (event) => event.impact === 'maintenance'- )- return { maintenanceEvents, incidents }-}--export type IncidentStatusData = Awaited<ReturnType<typeof getIncidentStatus>>-export type IncidentStatusError = unknown--export const useIncidentStatusQuery = <TData = IncidentStatusData>(- options: UseCustomQueryOptions<IncidentStatusData, IncidentStatusError, TData> = {}-) => {- return useQuery<IncidentStatusData, IncidentStatusError, TData>({- queryKey: platformKeys.incidentStatus(),- queryFn: ({ signal }) => getIncidentStatus(signal),- refetchOnWindowFocus: false,- // Use longer exponential backoff than the QueryClient default (base 4, cap 5 min vs base 2, cap 30s).- // The retryAfter header case is also handled here for consistency with query-client.ts.- retryDelay: (attemptIndex, error) => {- if (error instanceof ResponseError && error.retryAfter) {- return error.retryAfter * 1000- }- return Math.min(1000 * 4 ** attemptIndex, 1000 * 60 * 5)- },- ...options,- // Enable in platform mode, or in test environment for E2E testing- enabled: (IS_PLATFORM || IS_TEST_ENV) && (options.enabled ?? true),- })-}diff --git a/apps/studio/data/platform/incident-status-utils.ts b/apps/studio/data/platform/incident-status-utils.tsdeleted file mode 100644index 1f53e041c7a..00000000000--- a/apps/studio/data/platform/incident-status-utils.ts+++ /dev/null@@ -1,110 +0,0 @@-import type { IncidentInfo } from '@/lib/api/incident-status'--export type IncidentImpact = 'critical' | 'major' | 'maintenance' | 'minor' | 'none'--/**- * Impact priority order: higher priority = more severe- */-const IMPACT_PRIORITY: Record<IncidentImpact, number> = {- critical: 4,- major: 3,- maintenance: 2,- minor: 1,- none: 0,-}--const isIncidentImpact = (impact: string): impact is IncidentImpact => {- return Object.keys(IMPACT_PRIORITY).includes(impact)-}--export type IncidentStatus = 'investigating' | 'identified' | 'monitoring' | 'resolved'--/**- * Status priority order: higher priority = more urgent- */-const STATUS_PRIORITY: Record<IncidentStatus, number> = {- investigating: 4,- identified: 3,- monitoring: 2,- resolved: 1,-}--const isIncidentStatus = (status: string): status is IncidentStatus => {- return Object.keys(STATUS_PRIORITY).includes(status)-}--/**- * Sorts incidents by priority: first by impact, then by date, then by status.- *- * @param incidents Array of incidents to sort- * @returns New array of incidents sorted by priority- */-function sortIncidentsByPriority(incidents: Array<IncidentInfo>): Array<IncidentInfo> {- const incidentsCopy = [...incidents]-- incidentsCopy.sort((a, b) => {- const impactA = isIncidentImpact(a.impact) ? a.impact : 'none'- const impactB = isIncidentImpact(b.impact) ? b.impact : 'none'- const impactPriorityA = IMPACT_PRIORITY[impactA]- const impactPriorityB = IMPACT_PRIORITY[impactB]-- const dateA = new Date(a.active_since).getTime()- const dateB = new Date(b.active_since).getTime()- const hasDifferentDates = Number.isFinite(dateA) && Number.isFinite(dateB) && dateB !== dateA-- const statusA = isIncidentStatus(a.status) ? a.status : 'investigating'- const statusB = isIncidentStatus(b.status) ? b.status : 'investigating'- const statusPriorityA = STATUS_PRIORITY[statusA]- const statusPriorityB = STATUS_PRIORITY[statusB]-- if (impactPriorityB !== impactPriorityA) {- return impactPriorityB - impactPriorityA- } else if (hasDifferentDates) {- return dateB - dateA- } else {- return statusPriorityB - statusPriorityA- }- })-- return incidentsCopy-}--/**- * Checks if all incidents have the same status- *- * @param incidents Array of incidents to check- * @returns true if all incidents share the same status- */-function allIncidentsHaveSameStatus(incidents: Array<{ status: string }>): boolean {- if (incidents.length <= 1) return true- const firstStatus = incidents[0].status- return incidents.every((inc) => inc.status === firstStatus)-}--/**- * Processes incident data to extract useful metadata for display- */-export function processIncidentData(incidents: IncidentInfo[]) {- if (incidents.length === 0) {- return {- hasMultipleIncidents: false,- mostCriticalIncident: null,- overallStatus: 'investigating' as const,- allSameStatus: true,- }- }-- const hasMultipleIncidents = incidents.length > 1- const mostCriticalIncident = sortIncidentsByPriority(incidents)[0]- const overallStatus = isIncidentStatus(mostCriticalIncident.status)- ? mostCriticalIncident.status- : 'investigating'- const allSameStatus = allIncidentsHaveSameStatus(incidents)-- return {- hasMultipleIncidents,- mostCriticalIncident,- overallStatus,- allSameStatus,- }-}diff --git a/apps/studio/data/platform/keys.ts b/apps/studio/data/platform/keys.tsindex 1c5356b497f..48f33ca1c0b 100644--- a/apps/studio/data/platform/keys.ts+++ b/apps/studio/data/platform/keys.ts@@ -1,5 +1,3 @@export const platformKeys = {- incidentStatus: () => ['platform', 'incident-status'] as const,- incidentBanner: () => ['platform', 'incident-banner'] as const,statusPage: () => ['platform', 'status-page'] as const,}diff --git a/apps/studio/lib/ai/tools/incident-tools.test.ts b/apps/studio/lib/ai/tools/incident-tools.test.tsindex f62d3c7a0af..ca5e0498762 100644--- a/apps/studio/lib/ai/tools/incident-tools.test.ts+++ b/apps/studio/lib/ai/tools/incident-tools.test.ts@@ -9,6 +9,17 @@ vi.mock('common', () => ({const executeOptions = { toolCallId: 'test', messages: [], context: {} }+function statusPagePayload(overrides: Record<string, unknown> = {}) {+ return {+ page_title: 'Supabase',+ page_url: 'https://status.supabase.com',+ ongoing_incidents: [],+ in_progress_maintenances: [],+ scheduled_maintenances: [],+ ...overrides,+ }+}+describe('ai/tools/incident-tools', () => {let mockFetch: ReturnType<typeof vi.fn>let mockAbortSignal: AbortSignal@@ -63,113 +74,6 @@ describe('ai/tools/incident-tools', () => {expect(mockFetch).not.toHaveBeenCalled()})- it('should fetch incidents from correct URL', async () => {- const common = await import('common')- vi.spyOn(common, 'IS_PLATFORM', 'get').mockReturnValue(true)-- mockFetch.mockResolvedValue({- ok: true,- json: async () => [],- })-- const tools = getIncidentTools({ baseUrl: 'https://example.com/dashboard' })- if (!tools.get_active_incidents.execute) throw new Error('execute is undefined')- await tools.get_active_incidents.execute(- {},- { toolCallId: 'test', messages: [], context: {} }- )-- expect(mockFetch).toHaveBeenCalledWith(- 'https://example.com/dashboard/api/incident-status',- {- signal: expect.any(AbortSignal),- }- )- })-- it('should return message when no incidents', async () => {- const common = await import('common')- vi.spyOn(common, 'IS_PLATFORM', 'get').mockReturnValue(true)-- mockFetch.mockResolvedValue({- ok: true,- json: async () => [],- })-- const tools = getIncidentTools({ baseUrl: 'https://supabase.com/dashboard' })- const result = await (tools.get_active_incidents.execute as any)({}, executeOptions)-- expect(result).toEqual({- incidents: [],- message: expect.stringContaining('No active incidents'),- })- })-- it('should return incident summaries when incidents exist', async () => {- const common = await import('common')- vi.spyOn(common, 'IS_PLATFORM', 'get').mockReturnValue(true)-- const mockIncidents = [- {- name: 'Database slowness',- status: 'investigating',- impact: 'minor',- active_since: '2024-01-01T10:00:00Z',- extra_field: 'should be filtered',- },- ]-- mockFetch.mockResolvedValue({- ok: true,- json: async () => mockIncidents,- })-- const tools = getIncidentTools({ baseUrl: 'https://supabase.com/dashboard' })- const result = await (tools.get_active_incidents.execute as any)({}, executeOptions)-- expect((result as any).incidents).toEqual([- {- name: 'Database slowness',- status: 'investigating',- impact: 'minor',- active_since: '2024-01-01T10:00:00Z',- },- ])- expect((result as any).message).toContain('1 active incident')- expect((result as any).message).toContain('status.supabase.com')- })-- it('should handle multiple incidents', async () => {- const common = await import('common')- vi.spyOn(common, 'IS_PLATFORM', 'get').mockReturnValue(true)-- const mockIncidents = [- {- name: 'Database issue',- status: 'investigating',- impact: 'major',- active_since: '2024-01-01T10:00:00Z',- },- {- name: 'Storage issue',- status: 'identified',- impact: 'minor',- active_since: '2024-01-01T11:00:00Z',- },- ]-- mockFetch.mockResolvedValue({- ok: true,- json: async () => mockIncidents,- })-- const tools = getIncidentTools({ baseUrl: 'https://supabase.com/dashboard' })- const result = await (tools.get_active_incidents.execute as any)({}, executeOptions)-- expect((result as any).incidents).toHaveLength(2)- expect((result as any).message).toContain('2 active incidents')- })-it('throws on fetch errors', async () => {const common = await import('common')vi.spyOn(common, 'IS_PLATFORM', 'get').mockReturnValue(true)@@ -182,28 +86,13 @@ describe('ai/tools/incident-tools', () => {).rejects.toThrow('Network error')})- it('throws on non-ok responses with the status code', async () => {- const common = await import('common')- vi.spyOn(common, 'IS_PLATFORM', 'get').mockReturnValue(true)-- mockFetch.mockResolvedValue({- ok: false,- status: 500,- })-- const tools = getIncidentTools({ baseUrl: 'https://supabase.com/dashboard' })- await expect(- (tools.get_active_incidents.execute as any)({}, executeOptions)- ).rejects.toThrow('Failed to fetch incident status: 500')- })-it('should use timeout signal', async () => {const common = await import('common')vi.spyOn(common, 'IS_PLATFORM', 'get').mockReturnValue(true)mockFetch.mockResolvedValue({ok: true,- json: async () => [],+ json: async () => statusPagePayload(),})const tools = getIncidentTools({ baseUrl: 'https://supabase.com/dashboard' })@@ -220,7 +109,7 @@ describe('ai/tools/incident-tools', () => {it('cancels the request when the Assistant request is aborted', async () => {mockFetch.mockResolvedValue({ok: true,- json: async () => [],+ json: async () => statusPagePayload(),})const abortController = new AbortController()@@ -239,7 +128,7 @@ describe('ai/tools/incident-tools', () => {})})- describe('with useStatusPageWidget enabled', () => {+ describe('status page response', () => {beforeEach(async () => {const common = await import('common')vi.spyOn(common, 'IS_PLATFORM', 'get').mockReturnValue(true)@@ -267,27 +156,13 @@ describe('ai/tools/incident-tools', () => {started_at: '2026-01-01T00:00:00Z',}- function statusPagePayload(overrides: Record<string, unknown> = {}) {- return {- page_title: 'Supabase',- page_url: 'https://status.supabase.com',- ongoing_incidents: [],- in_progress_maintenances: [],- scheduled_maintenances: [],- ...overrides,- }- }-it('fetches from the status page endpoint', async () => {mockFetch.mockResolvedValue({ok: true,json: async () => statusPagePayload(),})- const tools = getIncidentTools({- baseUrl: 'https://example.com/dashboard',- useStatusPageWidget: true,- })+ const tools = getIncidentTools({ baseUrl: 'https://example.com/dashboard' })if (!tools.get_active_incidents.execute) throw new Error('execute is undefined')await tools.get_active_incidents.execute({}, executeOptions)@@ -309,10 +184,7 @@ describe('ai/tools/incident-tools', () => {}),})- const tools = getIncidentTools({- baseUrl: 'https://supabase.com/dashboard',- useStatusPageWidget: true,- })+ const tools = getIncidentTools({ baseUrl: 'https://supabase.com/dashboard' })const result = await (tools.get_active_incidents.execute as any)({}, executeOptions)expect((result as any).incidents).toHaveLength(1)@@ -331,10 +203,7 @@ describe('ai/tools/incident-tools', () => {}),})- const tools = getIncidentTools({- baseUrl: 'https://supabase.com/dashboard',- useStatusPageWidget: true,- })+ const tools = getIncidentTools({ baseUrl: 'https://supabase.com/dashboard' })const result = await (tools.get_active_incidents.execute as any)({}, executeOptions)expect((result as any).incidents).toHaveLength(1)@@ -366,10 +235,7 @@ describe('ai/tools/incident-tools', () => {}),})- const tools = getIncidentTools({- baseUrl: 'https://supabase.com/dashboard',- useStatusPageWidget: true,- })+ const tools = getIncidentTools({ baseUrl: 'https://supabase.com/dashboard' })const result = await (tools.get_active_incidents.execute as any)({}, executeOptions)expect((result as any).incidents).toHaveLength(2)@@ -389,10 +255,7 @@ describe('ai/tools/incident-tools', () => {}),})- const tools = getIncidentTools({- baseUrl: 'https://supabase.com/dashboard',- useStatusPageWidget: true,- })+ const tools = getIncidentTools({ baseUrl: 'https://supabase.com/dashboard' })const result = await (tools.get_active_incidents.execute as any)({}, executeOptions)expect((result as any).incidents).toHaveLength(1)@@ -406,10 +269,7 @@ describe('ai/tools/incident-tools', () => {json: async () => statusPagePayload(),})- const tools = getIncidentTools({- baseUrl: 'https://supabase.com/dashboard',- useStatusPageWidget: true,- })+ const tools = getIncidentTools({ baseUrl: 'https://supabase.com/dashboard' })const result = await (tools.get_active_incidents.execute as any)({}, executeOptions)expect(result).toEqual({@@ -424,10 +284,7 @@ describe('ai/tools/incident-tools', () => {json: async () => ({ this_is: 'not a valid status page response' }),})- const tools = getIncidentTools({- baseUrl: 'https://supabase.com/dashboard',- useStatusPageWidget: true,- })+ const tools = getIncidentTools({ baseUrl: 'https://supabase.com/dashboard' })await expect((tools.get_active_incidents.execute as any)({}, executeOptions)).rejects.toThrow('Failed to parse status page response')@@ -439,10 +296,7 @@ describe('ai/tools/incident-tools', () => {status: 500,})- const tools = getIncidentTools({- baseUrl: 'https://supabase.com/dashboard',- useStatusPageWidget: true,- })+ const tools = getIncidentTools({ baseUrl: 'https://supabase.com/dashboard' })await expect((tools.get_active_incidents.execute as any)({}, executeOptions)).rejects.toThrow('Failed to fetch status page: 500')diff --git a/apps/studio/lib/ai/tools/incident-tools.ts b/apps/studio/lib/ai/tools/incident-tools.tsindex d9e7a9cffbb..8997878f97f 100644--- a/apps/studio/lib/ai/tools/incident-tools.ts+++ b/apps/studio/lib/ai/tools/incident-tools.ts@@ -2,7 +2,6 @@ import { tool } from 'ai'import { IS_PLATFORM } from 'common'import { z } from 'zod'-import type { IncidentInfo } from '@/lib/api/incident-status'import {StatusPageResponseSchema,type AffectedComponent,@@ -46,17 +45,8 @@ function buildActiveIncidentsMessage(** @param baseUrl - The base URL for API requests (e.g., https://supabase.com/dashboard)* This should be the public URL to leverage CDN caching.- * @param useStatusPageWidget - When true, reads active incidents from the incident.io- * Widget API-backed status page endpoint instead of the- * legacy incident-status endpoint.*/-export const getIncidentTools = ({- baseUrl,- useStatusPageWidget,-}: {- baseUrl: string- useStatusPageWidget?: boolean-}) => ({+export const getIncidentTools = ({ baseUrl }: { baseUrl: string }) => ({get_active_incidents: tool({description:'Check for active incidents. Use this tool when the user reports issues with any Supabase service, including the database, authentication, realtime, storage, and functions. Possible problems include, but are not limited to, connection issues, timeouts, service unavailability, authentication failures, or unexpected errors.',@@ -69,96 +59,61 @@ export const getIncidentTools = ({}}- if (useStatusPageWidget) {- const response = await fetch(`${baseUrl}/api/status-page`, {- signal: timeoutSignal(abortSignal),- })-- if (!response.ok) {- throw new Error(`Failed to fetch status page: ${response.status}`)- }-- const json = await response.json()- const parseResult = StatusPageResponseSchema.safeParse(json)-- if (!parseResult.success) {- throw new Error(`Failed to parse status page response: ${parseResult.error.message}`)- }-- const { data } = parseResult-- const incidents = data.ongoing_incidents- .filter((incident) => incident.visible)- .map((incident) => ({- kind: 'incident' as const,- name: incident.name,- status: incident.status,- impact: incident.current_worst_impact,- affected_components: formatAffectedComponents(incident.affected_components),- last_update_message: incident.last_update_message ?? null,- url: incident.url,- }))-- const maintenances = data.in_progress_maintenances- .filter((maintenance) => maintenance.visible)- .map((maintenance) => ({- kind: 'maintenance' as const,- name: maintenance.name,- status: maintenance.status,- affected_components: formatAffectedComponents(maintenance.affected_components),- last_update_message: maintenance.last_update_message ?? null,- url: maintenance.url,- started_at: maintenance.started_at,- }))-- const combined = [...incidents, ...maintenances]-- if (combined.length === 0) {- return {- incidents: [],- message: NO_ACTIVE_INCIDENTS_MESSAGE,- }- }-- const statusPageUrl = data.page_url || DEFAULT_STATUS_PAGE_URL-- return {- incidents: combined,- message: buildActiveIncidentsMessage(- incidents.length,- maintenances.length,- statusPageUrl- ),- }- }-- const response = await fetch(`${baseUrl}/api/incident-status`, {+ const response = await fetch(`${baseUrl}/api/status-page`, {signal: timeoutSignal(abortSignal),})if (!response.ok) {- throw new Error(`Failed to fetch incident status: ${response.status}`)+ throw new Error(`Failed to fetch status page: ${response.status}`)}- const incidents: IncidentInfo[] = await response.json()+ const json = await response.json()+ const parseResult = StatusPageResponseSchema.safeParse(json)++ if (!parseResult.success) {+ throw new Error(`Failed to parse status page response: ${parseResult.error.message}`)+ }- if (incidents.length === 0) {+ const { data } = parseResult++ const incidents = data.ongoing_incidents+ .filter((incident) => incident.visible)+ .map((incident) => ({+ kind: 'incident' as const,+ name: incident.name,+ status: incident.status,+ impact: incident.current_worst_impact,+ affected_components: formatAffectedComponents(incident.affected_components),+ last_update_message: incident.last_update_message ?? null,+ url: incident.url,+ }))++ const maintenances = data.in_progress_maintenances+ .filter((maintenance) => maintenance.visible)+ .map((maintenance) => ({+ kind: 'maintenance' as const,+ name: maintenance.name,+ status: maintenance.status,+ affected_components: formatAffectedComponents(maintenance.affected_components),+ last_update_message: maintenance.last_update_message ?? null,+ url: maintenance.url,+ started_at: maintenance.started_at,+ }))++ const combined = [...incidents, ...maintenances]++ if (combined.length === 0) {return {incidents: [],message: NO_ACTIVE_INCIDENTS_MESSAGE,}}- const incidentSummaries = incidents.map((incident) => ({- name: incident.name,- status: incident.status,- impact: incident.impact,- active_since: incident.active_since,- }))+ const statusPageUrl = data.page_url || DEFAULT_STATUS_PAGE_URLreturn {- incidents: incidentSummaries,- message: buildActiveIncidentsMessage(incidents.length, 0, DEFAULT_STATUS_PAGE_URL),+ incidents: combined,+ message: buildActiveIncidentsMessage(incidents.length, maintenances.length, statusPageUrl),}},}),diff --git a/apps/studio/lib/ai/tools/index.ts b/apps/studio/lib/ai/tools/index.tsindex 3231dd0141c..23d2aff373f 100644--- a/apps/studio/lib/ai/tools/index.ts+++ b/apps/studio/lib/ai/tools/index.ts@@ -21,7 +21,6 @@ export const getTools = async ({baseUrl,supportMode,isExplorerEnabled,- useStatusPageWidget,signal,}: {projectRef: string@@ -35,7 +34,6 @@ export const getTools = async ({// assistant must not advertise list_notebooks/get_notebook until the caller confirms the// flag is on for this user.isExplorerEnabled?: boolean- useStatusPageWidget?: boolean// Required: tools fetched from the remote MCP server hold an HTTP connection// that is closed when this signal aborts (i.e. when the request ends).signal: AbortSignal@@ -92,7 +90,7 @@ export const getTools = async ({aiOptInLevel,}): {}),- ...(baseUrl ? getIncidentTools({ baseUrl, useStatusPageWidget }) : {}),+ ...(baseUrl ? getIncidentTools({ baseUrl }) : {}),}}diff --git a/apps/studio/lib/api/incident-banner.ts b/apps/studio/lib/api/incident-banner.tsdeleted file mode 100644index 5191cc1b78a..00000000000--- a/apps/studio/lib/api/incident-banner.ts+++ /dev/null@@ -1,146 +0,0 @@-import { createHash } from 'crypto'-import { IS_PROD } from 'common'-import z from 'zod'--import { InternalServerError } from '@/lib/api/apiHelpers'--const INCIDENT_IO_BASE_URL = 'https://api.incident.io/v2'--const BANNER_FIELD_ID = '01KKCFNW31EGRMD3JQ58E2TJ2M'-const METADATA_FIELD_ID = '01KKCD4KNWQ7HYSXT72CHB7WR4'--const MINOR_SEVERITY_ID = '01J7BTA8DEF371JQSXGBZYZY7D'--const SENTINEL_VALUE_SHOW_BANNER = '1'-const SENTINEL_VALUE_FORCE_BANNER = '100'--const FALLBACK_METADATA = { affected_regions: null, affects_project_creation: false }--const MetadataSchema = z.object({- affected_regions: z.union([z.array(z.string()), z.null()]),- affects_project_creation: z.boolean(),-})--interface CustomFieldValue {- value_option?: { id: string; value: string }- value_text?: string- value_numeric?: string-}--interface CustomFieldEntry {- custom_field: { id: string }- values: Array<CustomFieldValue>-}--interface Incident {- id: string- name: string- mode: string- created_at: string- custom_field_entries: Array<CustomFieldEntry>-}--interface IncidentIoListResponse {- incidents: Array<Incident>- pagination_meta?: { after?: string }-}--export type ShowBannerValue = true | 'force'--export interface BannerIncident {- id: string- show_banner: ShowBannerValue- metadata: z.infer<typeof MetadataSchema> & { force: boolean }-}--function getFieldValue(entries: Array<CustomFieldEntry>, fieldId: string): string | undefined {- const entry = entries.find((e) => e.custom_field.id === fieldId)- if (!entry || entry.values.length === 0) return undefined- const val = entry.values[0]- return val.value_option?.value ?? val.value_text ?? val.value_numeric-}--async function fetchAllIncidents(apiKey: string, mode: string): Promise<Array<Incident>> {- const incidents: Array<Incident> = []- let after: string | undefined-- do {- const params = new URLSearchParams()- params.append('status_category[one_of]', 'live')- params.append('severity[gte]', MINOR_SEVERITY_ID)- params.append('mode[one_of]', mode)- params.set('page_size', '25')- if (after) params.set('after', after)-- const response = await fetch(`${INCIDENT_IO_BASE_URL}/incidents?${params}`, {- headers: {- Authorization: `Bearer ${apiKey}`,- 'Content-Type': 'application/json',- },- next: { revalidate: 180 },- signal: AbortSignal.timeout(30_000),- })-- if (!response.ok) {- const retryAfter = response.headers.get('Retry-After') ?? undefined- const body = await response.text()- throw new InternalServerError(`incident.io API responded with ${response.status}`, {- status: response.status,- body,- ...(retryAfter !== undefined && { retryAfter }),- })- }-- const data: IncidentIoListResponse = await response.json()- incidents.push(...data.incidents)- after = data.pagination_meta?.after- } while (after)-- return incidents-}--/**- * Fetches active banner incidents from the incident.io API.- *- * @returns Array of banner incidents- * @throws Error if INCIDENT_IO_API_KEY is not set or the API returns an error- */-export async function getBannerIncidents(): Promise<Array<BannerIncident>> {- const apiKey = process.env.INCIDENT_IO_API_KEY- if (!apiKey) {- throw new Error('INCIDENT_IO_API_KEY is not set')- }-- const incidentMode = IS_PROD ? 'standard' : 'test'- const allIncidents = await fetchAllIncidents(apiKey, incidentMode)-- const bannerIncidents: Array<BannerIncident> = []-- for (const incident of allIncidents) {- const bannerValue = getFieldValue(incident.custom_field_entries, BANNER_FIELD_ID)- if (bannerValue !== SENTINEL_VALUE_SHOW_BANNER && bannerValue !== SENTINEL_VALUE_FORCE_BANNER) {- continue- }-- const metadataRaw = getFieldValue(incident.custom_field_entries, METADATA_FIELD_ID)-- let parsedJson: unknown = null- try {- parsedJson = JSON.parse(metadataRaw ?? 'null')- } catch {- // malformed JSON — fall through to default metadata- }- const parsed = MetadataSchema.safeParse(parsedJson)- const metadata: z.infer<typeof MetadataSchema> = parsed.success- ? parsed.data- : FALLBACK_METADATA-- bannerIncidents.push({- id: createHash('sha256').update(incident.created_at).digest('hex'),- show_banner: bannerValue === SENTINEL_VALUE_FORCE_BANNER ? 'force' : true,- metadata: { ...metadata, force: bannerValue === SENTINEL_VALUE_FORCE_BANNER },- })- }-- return bannerIncidents-}diff --git a/apps/studio/lib/api/incident-status.ts b/apps/studio/lib/api/incident-status.tsdeleted file mode 100644index 9bc6aab77bc..00000000000--- a/apps/studio/lib/api/incident-status.ts+++ /dev/null@@ -1,146 +0,0 @@-import { IS_PLATFORM } from 'common'-import z from 'zod'--import { InternalServerError } from '@/lib/api/apiHelpers'--export type IncidentCache = {- affected_regions: Array<string> | null- affects_project_creation: boolean- /** When true, the banner is shown unconditionally regardless of regions or project state. */- force?: boolean-}--export type IncidentMetadata = {- dashboard_metadata?: {- show_banner?: boolean- }-}--export type IncidentInfo = {- id: string- name: string- status: string- impact: string- active_since: string- metadata: IncidentMetadata- cache?: IncidentCache | null-}--const STATUSPAGE_API_URL = 'https://api.statuspage.io/v1'-const STATUSPAGE_PAGE_ID = process.env.STATUSPAGE_PAGE_ID-const STATUSPAGE_API_KEY = process.env.STATUSPAGE_API_KEY--function getIncidentsEndpoint(): string {- return `${STATUSPAGE_API_URL}/pages/${STATUSPAGE_PAGE_ID}/incidents/unresolved`-}--const StatusPageIncidentsSchema = z.array(- z.object({- id: z.string(),- name: z.string(),- status: z.string(),- created_at: z.string(),- scheduled_for: z.string().nullable(),- impact: z.string(),- metadata: z- .object({- dashboard_metadata: z- .object({- show_banner: z.boolean().optional(),- })- .optional(),- })- .optional()- .default({}),- })-)--/**- * Fetches active incidents from the StatusPage API.- * This function is used both by the API route and the AI assistant.- *- * @returns Array of active incidents- * @throws InternalServerError if StatusPage is not configured or returns an error- */-export async function getActiveIncidents(): Promise<IncidentInfo[]> {- if (!IS_PLATFORM) {- return []- }-- if (!STATUSPAGE_PAGE_ID) {- throw new InternalServerError('StatusPage page ID is not configured')- }-- if (!STATUSPAGE_API_KEY) {- throw new InternalServerError('StatusPage API key is not configured')- }-- const response = await fetch(getIncidentsEndpoint(), {- headers: {- Authorization: `OAuth ${STATUSPAGE_API_KEY}`,- Accept: 'application/json',- 'Content-Type': 'application/json',- },- next: { revalidate: 180 },- signal: AbortSignal.timeout(30_000),- })- const responseText = await response.text()-- if (!response.ok) {- const retryAfter = response.headers.get('Retry-After') ?? undefined- throw new InternalServerError(`StatusPage API responded with ${response.status}`, {- status: response.status,- body: responseText,- ...(retryAfter !== undefined && { retryAfter }),- })- }-- let incidentsJson: unknown- try {- incidentsJson = JSON.parse(responseText)- } catch (error) {- throw new InternalServerError('StatusPage API response could not be parsed as JSON', {- error: error instanceof Error ? error.message : error,- body: responseText,- })- }-- const result = StatusPageIncidentsSchema.safeParse(incidentsJson)-- if (!result.success) {- throw new InternalServerError('StatusPage API response did not match expected schema', {- issues: result.error.issues,- })- }-- const now = Date.now()- const activeIncidents = result.data.filter((incident) => {- const hasNoScheduledTime = !incident.scheduled_for- if (hasNoScheduledTime) {- return true- }-- const scheduledTime = Date.parse(incident.scheduled_for!)- const isScheduledTimeInvalid = Number.isNaN(scheduledTime)- if (isScheduledTimeInvalid) {- // Keep the record but note it locally for debugging- console.warn('Encountered incident with invalid scheduled_for date', {- incidentId: incident.id,- scheduled_for: incident.scheduled_for,- })- return true- }-- const hasScheduledTimePassed = scheduledTime <= now- return hasScheduledTimePassed- })-- return activeIncidents.map((incident) => ({- id: incident.id,- name: incident.name,- status: incident.status,- impact: incident.impact,- active_since: incident.scheduled_for ?? incident.created_at,- metadata: incident.metadata,- }))-}diff --git a/apps/studio/lib/api/supabase-admin.ts b/apps/studio/lib/api/supabase-admin.tsdeleted file mode 100644index e6a19f7008b..00000000000--- a/apps/studio/lib/api/supabase-admin.ts+++ /dev/null@@ -1,9 +0,0 @@-import { createClient } from '@supabase/supabase-js'--/**- * Creates a Supabase client using the secret key.- * For use in server-side API routes only.- */-export function createAdminClient() {- return createClient(process.env.NEXT_PUBLIC_SUPABASE_URL!, process.env.LIVE_SUPABASE_SECRET_KEY!)-}diff --git a/apps/studio/lib/hosted-api-allowlist.ts b/apps/studio/lib/hosted-api-allowlist.tsindex 59c7b0c80bf..32a0c84302f 100644--- a/apps/studio/lib/hosted-api-allowlist.ts+++ b/apps/studio/lib/hosted-api-allowlist.ts@@ -21,10 +21,7 @@ export const HOSTED_SUPPORTED_API_URLS = ['/edge-functions/test','/edge-functions/body','/generate-attachment-url',- '/incident-status',- '/incident-banner','/status-page',- '/status-override','/api/integrations/stripe-sync','/content/graphql','/parse-query',diff --git a/apps/studio/pages/api/ai/sql/generate-v4.ts b/apps/studio/pages/api/ai/sql/generate-v4.tsindex 17164f71eea..d6cabafd39a 100644--- a/apps/studio/pages/api/ai/sql/generate-v4.ts+++ b/apps/studio/pages/api/ai/sql/generate-v4.ts@@ -31,7 +31,7 @@ import { encodeNotebookToolError } from '@/lib/ai/tools/notebook-tool-error'import { apiWrapper } from '@/lib/api/apiWrapper'import { executeQuery } from '@/lib/api/self-hosted/query'import { getBasePathURL } from '@/lib/helpers'-import { isServerFlagEnabled, trustedUserEmail } from '@/lib/server/configcat'+import { trustedUserEmail } from '@/lib/server/configcat'export const maxDuration = 300@@ -153,10 +153,7 @@ async function handlePost(req: NextApiRequest, res: NextApiResponse, claims?: Jw}}- const [explorerEnabled, useStatusPageWidget] = await Promise.all([- isExplorerEnabled(trustedUserEmail(claims?.email)),- isServerFlagEnabled('incidentIoStatusPage'),- ])+ const explorerEnabled = await isExplorerEnabled(trustedUserEmail(claims?.email))const envThrottled = process.env.IS_THROTTLED !== 'false'@@ -195,7 +192,6 @@ async function handlePost(req: NextApiRequest, res: NextApiResponse, claims?: JwbaseUrl: getBasePathURL(),supportMode,isExplorerEnabled: explorerEnabled,- useStatusPageWidget,signal: abortController.signal,})diff --git a/apps/studio/pages/api/status-override.ts b/apps/studio/pages/api/status-override.tsdeleted file mode 100644index 145cc1dd4e3..00000000000--- a/apps/studio/pages/api/status-override.ts+++ /dev/null@@ -1,19 +0,0 @@-import { IS_PLATFORM } from 'common'-import { NextApiRequest, NextApiResponse } from 'next'--type ResponseData = { enabled: boolean }--export default function handler(req: NextApiRequest, res: NextApiResponse<ResponseData>) {- if (!IS_PLATFORM) {- return res.status(404).end()- }-- if (req.method !== 'GET') {- res.setHeader('Allow', ['GET'])- return res.status(405).end()- }-- return res.status(200).json({- enabled: process.env.NEXT_PUBLIC_ONGOING_INCIDENT === 'true',- })-}diff --git a/apps/studio/routeTree.gen.ts b/apps/studio/routeTree.gen.tsindex a7aeae2a9d3..35170b59492 100644--- a/apps/studio/routeTree.gen.ts+++ b/apps/studio/routeTree.gen.ts@@ -41,11 +41,8 @@ import { Route as ApiGetDeploymentCommitRouteImport } from './routes/api/get-depimport { Route as ApiGetIpAddressRouteImport } from './routes/api/get-ip-address'import { Route as ApiGetS3KeysRouteImport } from './routes/api/get-s3-keys'import { Route as ApiGetUtcTimeRouteImport } from './routes/api/get-utc-time'-import { Route as ApiIncidentBannerRouteImport } from './routes/api/incident-banner'-import { Route as ApiIncidentStatusRouteImport } from './routes/api/incident-status'import { Route as ApiParseQueryRouteImport } from './routes/api/parse-query'import { Route as ApiScopedAccessTokenPermissionsRouteImport } from './routes/api/scoped-access-token-permissions'-import { Route as ApiStatusOverrideRouteImport } from './routes/api/status-override'import { Route as ApiStatusPageRouteImport } from './routes/api/status-page'import { Route as IntegrationsVercelRouteImport } from './routes/integrations/vercel'import { Route as McpSecretsRouteImport } from './routes/mcp/secrets'@@ -498,16 +495,6 @@ const ApiGetUtcTimeRoute = ApiGetUtcTimeRouteImport.update({path: '/api/get-utc-time',getParentRoute: () => rootRouteImport,} as any)-const ApiIncidentBannerRoute = ApiIncidentBannerRouteImport.update({- id: '/api/incident-banner',- path: '/api/incident-banner',- getParentRoute: () => rootRouteImport,-} as any)-const ApiIncidentStatusRoute = ApiIncidentStatusRouteImport.update({- id: '/api/incident-status',- path: '/api/incident-status',- getParentRoute: () => rootRouteImport,-} as any)const ApiParseQueryRoute = ApiParseQueryRouteImport.update({id: '/api/parse-query',path: '/api/parse-query',@@ -519,11 +506,6 @@ const ApiScopedAccessTokenPermissionsRoute =path: '/api/scoped-access-token-permissions',getParentRoute: () => rootRouteImport,} as any)-const ApiStatusOverrideRoute = ApiStatusOverrideRouteImport.update({- id: '/api/status-override',- path: '/api/status-override',- getParentRoute: () => rootRouteImport,-} as any)const ApiStatusPageRoute = ApiStatusPageRouteImport.update({id: '/api/status-page',path: '/api/status-page',@@ -2195,11 +2177,8 @@ export interface FileRoutesByFullPath {'/api/get-ip-address': typeof ApiGetIpAddressRoute'/api/get-s3-keys': typeof ApiGetS3KeysRoute'/api/get-utc-time': typeof ApiGetUtcTimeRoute- '/api/incident-banner': typeof ApiIncidentBannerRoute- '/api/incident-status': typeof ApiIncidentStatusRoute'/api/parse-query': typeof ApiParseQueryRoute'/api/scoped-access-token-permissions': typeof ApiScopedAccessTokenPermissionsRoute- '/api/status-override': typeof ApiStatusOverrideRoute'/api/status-page': typeof ApiStatusPageRoute'/integrations/vercel': typeof IntegrationsVercelRouteWithChildren'/mcp/secrets': typeof McpSecretsRoute@@ -2521,11 +2500,8 @@ export interface FileRoutesByTo {'/api/get-ip-address': typeof ApiGetIpAddressRoute'/api/get-s3-keys': typeof ApiGetS3KeysRoute'/api/get-utc-time': typeof ApiGetUtcTimeRoute- '/api/incident-banner': typeof ApiIncidentBannerRoute- '/api/incident-status': typeof ApiIncidentStatusRoute'/api/parse-query': typeof ApiParseQueryRoute'/api/scoped-access-token-permissions': typeof ApiScopedAccessTokenPermissionsRoute- '/api/status-override': typeof ApiStatusOverrideRoute'/api/status-page': typeof ApiStatusPageRoute'/integrations/vercel': typeof IntegrationsVercelRouteWithChildren'/mcp/secrets': typeof McpSecretsRoute@@ -2837,11 +2813,8 @@ export interface FileRoutesById {'/api/get-ip-address': typeof ApiGetIpAddressRoute'/api/get-s3-keys': typeof ApiGetS3KeysRoute'/api/get-utc-time': typeof ApiGetUtcTimeRoute- '/api/incident-banner': typeof ApiIncidentBannerRoute- '/api/incident-status': typeof ApiIncidentStatusRoute'/api/parse-query': typeof ApiParseQueryRoute'/api/scoped-access-token-permissions': typeof ApiScopedAccessTokenPermissionsRoute- '/api/status-override': typeof ApiStatusOverrideRoute'/api/status-page': typeof ApiStatusPageRoute'/integrations/vercel': typeof IntegrationsVercelRouteWithChildren'/mcp/secrets': typeof McpSecretsRoute@@ -3166,11 +3139,8 @@ export interface FileRouteTypes {| '/api/get-ip-address'| '/api/get-s3-keys'| '/api/get-utc-time'- | '/api/incident-banner'- | '/api/incident-status'| '/api/parse-query'| '/api/scoped-access-token-permissions'- | '/api/status-override'| '/api/status-page'| '/integrations/vercel'| '/mcp/secrets'@@ -3492,11 +3462,8 @@ export interface FileRouteTypes {| '/api/get-ip-address'| '/api/get-s3-keys'| '/api/get-utc-time'- | '/api/incident-banner'- | '/api/incident-status'| '/api/parse-query'| '/api/scoped-access-token-permissions'- | '/api/status-override'| '/api/status-page'| '/integrations/vercel'| '/mcp/secrets'@@ -3807,11 +3774,8 @@ export interface FileRouteTypes {| '/api/get-ip-address'| '/api/get-s3-keys'| '/api/get-utc-time'- | '/api/incident-banner'- | '/api/incident-status'| '/api/parse-query'| '/api/scoped-access-token-permissions'- | '/api/status-override'| '/api/status-page'| '/integrations/vercel'| '/mcp/secrets'@@ -4125,11 +4089,8 @@ export interface RootRouteChildren {ApiGetIpAddressRoute: typeof ApiGetIpAddressRouteApiGetS3KeysRoute: typeof ApiGetS3KeysRouteApiGetUtcTimeRoute: typeof ApiGetUtcTimeRoute- ApiIncidentBannerRoute: typeof ApiIncidentBannerRoute- ApiIncidentStatusRoute: typeof ApiIncidentStatusRouteApiParseQueryRoute: typeof ApiParseQueryRouteApiScopedAccessTokenPermissionsRoute: typeof ApiScopedAccessTokenPermissionsRoute- ApiStatusOverrideRoute: typeof ApiStatusOverrideRouteApiStatusPageRoute: typeof ApiStatusPageRouteIntegrationsVercelRoute: typeof IntegrationsVercelRouteWithChildrenMcpSecretsRoute: typeof McpSecretsRoute@@ -4458,20 +4419,6 @@ declare module '@tanstack/react-router' {preLoaderRoute: typeof ApiGetUtcTimeRouteImportparentRoute: typeof rootRouteImport}- '/api/incident-banner': {- id: '/api/incident-banner'- path: '/api/incident-banner'- fullPath: '/api/incident-banner'- preLoaderRoute: typeof ApiIncidentBannerRouteImport- parentRoute: typeof rootRouteImport- }- '/api/incident-status': {- id: '/api/incident-status'- path: '/api/incident-status'- fullPath: '/api/incident-status'- preLoaderRoute: typeof ApiIncidentStatusRouteImport- parentRoute: typeof rootRouteImport- }'/api/parse-query': {id: '/api/parse-query'path: '/api/parse-query'@@ -4486,13 +4433,6 @@ declare module '@tanstack/react-router' {preLoaderRoute: typeof ApiScopedAccessTokenPermissionsRouteImportparentRoute: typeof rootRouteImport}- '/api/status-override': {- id: '/api/status-override'- path: '/api/status-override'- fullPath: '/api/status-override'- preLoaderRoute: typeof ApiStatusOverrideRouteImport- parentRoute: typeof rootRouteImport- }'/api/status-page': {id: '/api/status-page'path: '/api/status-page'@@ -7285,11 +7225,8 @@ const rootRouteChildren: RootRouteChildren = {ApiGetIpAddressRoute: ApiGetIpAddressRoute,ApiGetS3KeysRoute: ApiGetS3KeysRoute,ApiGetUtcTimeRoute: ApiGetUtcTimeRoute,- ApiIncidentBannerRoute: ApiIncidentBannerRoute,- ApiIncidentStatusRoute: ApiIncidentStatusRoute,ApiParseQueryRoute: ApiParseQueryRoute,ApiScopedAccessTokenPermissionsRoute: ApiScopedAccessTokenPermissionsRoute,- ApiStatusOverrideRoute: ApiStatusOverrideRoute,ApiStatusPageRoute: ApiStatusPageRoute,IntegrationsVercelRoute: IntegrationsVercelRouteWithChildren,McpSecretsRoute: McpSecretsRoute,diff --git a/apps/studio/routes/api/incident-banner.ts b/apps/studio/routes/api/incident-banner.tsdeleted file mode 100644index 37ee873fbd7..00000000000--- a/apps/studio/routes/api/incident-banner.ts+++ /dev/null@@ -1,16 +0,0 @@-import { createFileRoute } from '@tanstack/react-router'--// App Router route (apps/studio/app/api/incident-banner/route.ts) — already-// Web-native, uses NextResponse which extends `Response`. Direct re-export of-// each HTTP method; no shim needed.-import { GET, HEAD, OPTIONS } from '@/app/api/incident-banner/route'--export const Route = createFileRoute('/api/incident-banner')({- server: {- handlers: {- GET: () => GET(),- HEAD: () => HEAD(),- OPTIONS: () => OPTIONS(),- },- },-})diff --git a/apps/studio/routes/api/incident-status.ts b/apps/studio/routes/api/incident-status.tsdeleted file mode 100644index 631d579582d..00000000000--- a/apps/studio/routes/api/incident-status.ts+++ /dev/null@@ -1,16 +0,0 @@-import { createFileRoute } from '@tanstack/react-router'--// App Router route (apps/studio/app/api/incident-status/route.ts) — already-// Web-native, uses NextResponse which extends `Response`. Direct re-export of-// each HTTP method; no shim needed.-import { GET, HEAD, OPTIONS } from '@/app/api/incident-status/route'--export const Route = createFileRoute('/api/incident-status')({- server: {- handlers: {- GET: () => GET(),- HEAD: () => HEAD(),- OPTIONS: () => OPTIONS(),- },- },-})diff --git a/apps/studio/routes/api/status-override.ts b/apps/studio/routes/api/status-override.tsdeleted file mode 100644index 28f908f2fab..00000000000--- a/apps/studio/routes/api/status-override.ts+++ /dev/null@@ -1,10 +0,0 @@-import { createFileRoute } from '@tanstack/react-router'--import { toWebHandler } from '@/compat/next/api'-import statusOverride from '@/pages/api/status-override'--const handler = toWebHandler(statusOverride)--export const Route = createFileRoute('/api/status-override')({- server: { handlers: { GET: handler } },-})diff --git a/apps/studio/tests/pages/new/[slug].test.tsx b/apps/studio/tests/pages/new/[slug].test.tsxindex 76f096b0c21..07eb11c6cf2 100644--- a/apps/studio/tests/pages/new/[slug].test.tsx+++ b/apps/studio/tests/pages/new/[slug].test.tsx@@ -263,12 +263,6 @@ function mockWizardEndpoints(// @ts-expect-error - authorization payload isn't inspected beyond truthinessresponse: () => HttpResponse.json(overrides.githubAuthorization ?? null),})- addAPIMock({- method: 'get',- // @ts-expect-error - raw-fetch Next.js API route, not in the generated paths type- path: '/incident-status',- response: () => HttpResponse.json([]),- })addAPIMock({method: 'get',path: '/platform/integrations/github/repositories',diff --git a/apps/studio/turbo.jsonc b/apps/studio/turbo.jsoncindex 10744f33bab..cb4c73574dc 100644--- a/apps/studio/turbo.jsonc+++ b/apps/studio/turbo.jsonc@@ -105,12 +105,9 @@"AI_PRO_MODEL","AI_NORMAL_MODEL","SUPPORT_SUPABASE_SECRET_KEY",- "STATUSPAGE_API_KEY",- "STATUSPAGE_PAGE_ID","INCIDENT_IO_API_KEY","INCIDENT_IO_WIDGET_URL","INCIDENT_IO_STATUS_PAGE_ID",- "LIVE_SUPABASE_SECRET_KEY",// Selects the build mode for the studio's `build`/`start` scripts// (e.g. e2e sets `MODE=test`). Listed so turbo invalidates the// cache when it changes — without this, switching between test anddiff --git a/packages/common/constants/local-storage.ts b/packages/common/constants/local-storage.tsindex e9204fee10e..cfcfa5eef85 100644--- a/packages/common/constants/local-storage.ts+++ b/packages/common/constants/local-storage.ts@@ -14,7 +14,6 @@ export const LOCAL_STORAGE_KEYS = {PROJECTS_SORT: 'projects-sort',FEEDBACK_WIDGET_CONTENT: 'feedback-widget-content',FEEDBACK_WIDGET_SCREENSHOT: 'feedback-widget-screenshot',- INCIDENT_BANNER_DISMISSED_IDS: 'incident-banner-dismissed-ids',STATUS_BANNER_DISMISSED_KEYS: 'status-banner-dismissed-keys',DASHBOARD_PREFERENCES: (ref: string) => `dashboard-preferences-${ref}`,HOME_CHART_INTERVAL: (ref: string) => `home-chart-interval-${ref}`,