The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
Add a notice for the planned middleware outage (#35723)
Terry Sutton0f911961547c
diff --git a/apps/studio/components/interfaces/App/AppBannerWrapperContext.tsx b/apps/studio/components/interfaces/App/AppBannerWrapperContext.tsxindex 9ccbbf6fbb0..07ac280ea3f 100644--- a/apps/studio/components/interfaces/App/AppBannerWrapperContext.tsx+++ b/apps/studio/components/interfaces/App/AppBannerWrapperContext.tsx@@ -2,40 +2,41 @@ import { LOCAL_STORAGE_KEYS } from 'common'import { noop } from 'lodash'import { PropsWithChildren, createContext, useContext, useEffect, useState } from 'react'-const FLY_POSTGRES_DEPRECATION_WARNING_KEY = LOCAL_STORAGE_KEYS.FLY_POSTGRES_DEPRECATION_WARNING+const MIDDLEWARE_OUTAGE_BANNER_KEY = LOCAL_STORAGE_KEYS.MIDDLEWARE_OUTAGE_BANNER// [Joshen] This file is meant to be dynamic - update this as and when we need to use the NoticeBannertype AppBannerContextType = {- flyPostgresBannerAcknowledged: boolean- onUpdateAcknowledged: (key: 'fly-postgres') => void+ middlewareOutageBannerAcknowledged: boolean+ onUpdateAcknowledged: (key: typeof MIDDLEWARE_OUTAGE_BANNER_KEY) => void}const AppBannerContext = createContext<AppBannerContextType>({- flyPostgresBannerAcknowledged: false,+ middlewareOutageBannerAcknowledged: false,onUpdateAcknowledged: noop,})export const useAppBannerContext = () => useContext(AppBannerContext)export const AppBannerContextProvider = ({ children }: PropsWithChildren<{}>) => {- const [flyPostgresBannerAcknowledged, setFlyPostgresBannerAcknowledged] = useState<boolean>(false)+ const [middlewareOutageBannerAcknowledged, setmiddlewareOutageBannerAcknowledged] =+ useState<boolean>(false)useEffect(() => {if (typeof window !== 'undefined') {- const acknowledged = localStorage.getItem(FLY_POSTGRES_DEPRECATION_WARNING_KEY) === 'true'- setFlyPostgresBannerAcknowledged(acknowledged)+ const acknowledged = localStorage.getItem(MIDDLEWARE_OUTAGE_BANNER_KEY) === 'true'+ setmiddlewareOutageBannerAcknowledged(acknowledged)}}, [])const value = {- flyPostgresBannerAcknowledged,- onUpdateAcknowledged: (key: 'fly-postgres') => {- if (key === 'fly-postgres') {+ middlewareOutageBannerAcknowledged,+ onUpdateAcknowledged: (key: typeof MIDDLEWARE_OUTAGE_BANNER_KEY) => {+ if (key === MIDDLEWARE_OUTAGE_BANNER_KEY) {if (typeof window !== 'undefined') {- window.localStorage.setItem(FLY_POSTGRES_DEPRECATION_WARNING_KEY, 'true')+ window.localStorage.setItem(MIDDLEWARE_OUTAGE_BANNER_KEY, 'true')}- setFlyPostgresBannerAcknowledged(true)+ setmiddlewareOutageBannerAcknowledged(true)}},}@@ -44,6 +45,6 @@ export const AppBannerContextProvider = ({ children }: PropsWithChildren<{}>) =>}export const useIsNoticeBannerShown = () => {- const { flyPostgresBannerAcknowledged } = useAppBannerContext()- return flyPostgresBannerAcknowledged+ const { middlewareOutageBannerAcknowledged } = useAppBannerContext()+ return middlewareOutageBannerAcknowledged}diff --git a/apps/studio/components/layouts/AppLayout/NoticeBanner.tsx b/apps/studio/components/layouts/AppLayout/NoticeBanner.tsxindex 71ff2fabe3b..9b1b95a1e70 100644--- a/apps/studio/components/layouts/AppLayout/NoticeBanner.tsx+++ b/apps/studio/components/layouts/AppLayout/NoticeBanner.tsx@@ -2,43 +2,35 @@ import { ExternalLink } from 'lucide-react'import { useRouter } from 'next/router'import { useAppBannerContext } from 'components/interfaces/App/AppBannerWrapperContext'-import { useProfile } from 'lib/profile'-import { Button } from 'ui'+import { Button, WarningIcon } from 'ui'// This file, like AppBannerWrapperContext.tsx, is meant to be dynamic - update this as and when we need to use the NoticeBanner--// [Alaister] As of 11th February 2025, this notice is around Fly's Postgres offering-// https://github.com/orgs/supabase/discussions/33413-// Timelines TLDR:-// - Before April 11 2025: Users will still be able to access your existing Fly Postgres projects.-// - On April 11 2025: Your Fly Postgres projects are removed from our platform-// We can disable this banner after 14th March 2025 as the Fly Postgres offering is no longer available+// We can disable this banner after 16th May 2025 as the middleware outage is completeexport const NoticeBanner = () => {const router = useRouter()- const { isLoading: isLoadingProfile, profile } = useProfile()const appBannerContext = useAppBannerContext()- const { flyPostgresBannerAcknowledged, onUpdateAcknowledged } = appBannerContext+ const { middlewareOutageBannerAcknowledged, onUpdateAcknowledged } = appBannerContext- const isFlyUser = Boolean(profile?.primary_email?.endsWith('customer.fly.io'))- const acknowledged = flyPostgresBannerAcknowledged+ const acknowledged = middlewareOutageBannerAcknowledged- if (isLoadingProfile || !isFlyUser || router.pathname.includes('sign-in') || acknowledged) {+ if (router.pathname.includes('sign-in') || acknowledged) {return null}return (<div className="flex items-center justify-center gap-x-4 bg py-0.5 border transition text-foreground border-default">+ <WarningIcon className="w-4 h-4" /><p className="text-sm">- Supabase is deprecating Fly's Postgres offering managed by Supabase on April 11, 2025+ Brief Dashboard outage: May 16, 2025, 22:00–23:00 UTC (no impact to your apps)</p><div className="flex items-center gap-x-1"><Button asChild type="link" iconRight={<ExternalLink size={14} />}><atarget="_blank"rel="noreferrer"- href="https://github.com/orgs/supabase/discussions/33413"+ href="https://status.supabase.com/incidents/8k0ysqkhscfj">Learn more</a>@@ -47,7 +39,7 @@ export const NoticeBanner = () => {type="text"className="opacity-75"onClick={() => {- onUpdateAcknowledged('fly-postgres')+ onUpdateAcknowledged('middleware-outage-banner-2025-05-16')}}>Dismissdiff --git a/packages/common/constants/local-storage.ts b/packages/common/constants/local-storage.tsindex 93b23767dd8..40351994e81 100644--- a/packages/common/constants/local-storage.ts+++ b/packages/common/constants/local-storage.ts@@ -51,6 +51,7 @@ export const LOCAL_STORAGE_KEYS = {GITHUB_AUTHORIZATION_STATE: 'supabase-github-authorization-state',// Notice banner keysFLY_POSTGRES_DEPRECATION_WARNING: 'fly-postgres-deprecation-warning-dismissed',+ MIDDLEWARE_OUTAGE_BANNER: 'middleware-outage-banner-2025-05-16',AUTH_USERS_COLUMNS_CONFIGURATION: (ref: string) => `supabase-auth-users-columns-${ref}`,// api keys view switcher for new and legacy api keys