Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

feat(studio): add logs.all deprecation banner (#49059)

Mert YEREKAPAN65033221fb12
diff --git a/apps/studio/components/interfaces/App/AppBannerWrapper.tsx b/apps/studio/components/interfaces/App/AppBannerWrapper.tsx
index dbb1d6cef96..a0e19ea5d92 100644
--- a/apps/studio/components/interfaces/App/AppBannerWrapper.tsx
+++ b/apps/studio/components/interfaces/App/AppBannerWrapper.tsx
@@ -1,21 +1,35 @@
-import { LOCAL_STORAGE_KEYS, useFlag } from 'common'
-import { PropsWithChildren, useEffect } from 'react'
+import { IS_PLATFORM, LOCAL_STORAGE_KEYS, useFlag } from 'common'
+import dayjs from 'dayjs'
+import { usePathname } from 'next/navigation'
+import { PropsWithChildren, useEffect, useRef, useState } from 'react'
import { OrganizationResourceBanner } from '../Organization/HeaderBanner'
+import { isLogsOrObservabilityPath } from './AppBannerWrapper.utils'
import { ClockSkewBanner } from '@/components/layouts/AppLayout/ClockSkewBanner'
import { NoticeBanner } from '@/components/layouts/AppLayout/NoticeBanner'
import { StatusPageBanner } from '@/components/layouts/AppLayout/StatusPageBanner'
+import { BannerLogsAllDeprecation } from '@/components/ui/BannerStack/Banners/BannerLogsAllDeprecation'
import { BannerTOSUpdate } from '@/components/ui/BannerStack/Banners/BannerTOSUpdate'
-import { useBannerStack } from '@/components/ui/BannerStack/BannerStackProvider'
+import { BANNER_ID, useBannerStack } from '@/components/ui/BannerStack/BannerStackProvider'
import { useLocalStorageQuery } from '@/hooks/misc/useLocalStorage'
+import { useTrack } from '@/lib/telemetry/track'
const TOSUpdateExpiry = new Date('2026-08-29T00:00:00Z')
+// Update this whenever the banner content changes so old client bundles stop
+// displaying the notice after the removal date passes.
+const LogsAllDeprecationExpiry = dayjs('2026-09-24T00:00:00Z')
+
+// setTimeout overflows above ~24.8 days; re-arm until the real expiry.
+const MAX_TIMEOUT_MS = 2_147_483_647
+
export const AppBannerWrapper = ({ children }: PropsWithChildren<{}>) => {
const showNoticeBanner = useFlag('showNoticeBanner')
const clockSkewBanner = useFlag('clockSkewBanner')
const { addBanner, dismissBanner } = useBannerStack()
+ const pathname = usePathname()
+ const track = useTrack()
const [TOSUpdateAcknowledged, , { isSuccess }] = useLocalStorageQuery(
LOCAL_STORAGE_KEYS.TERMS_OF_SERVICE_UPDATE,
@@ -37,6 +51,67 @@ export const AppBannerWrapper = ({ children }: PropsWithChildren<{}>) => {
}
}, [TOSUpdateAcknowledged, isSuccess, addBanner, dismissBanner])
+ const [isLogsAllDeprecationDismissed, , { isSuccess: isLogsAllDeprecationLoaded }] =
+ useLocalStorageQuery(LOCAL_STORAGE_KEYS.LOGS_ALL_DEPRECATION_2026_09_23, false)
+
+ const [isLogsAllDeprecationExpired, setIsLogsAllDeprecationExpired] = useState(
+ () => !dayjs().isBefore(LogsAllDeprecationExpiry)
+ )
+
+ useEffect(() => {
+ if (isLogsAllDeprecationExpired) return
+
+ let timeoutId: ReturnType<typeof setTimeout> | undefined
+
+ const armExpiryTimer = () => {
+ const msUntilExpiry = LogsAllDeprecationExpiry.diff(dayjs())
+ if (msUntilExpiry <= 0) {
+ setIsLogsAllDeprecationExpired(true)
+ return
+ }
+ timeoutId = setTimeout(armExpiryTimer, Math.min(msUntilExpiry, MAX_TIMEOUT_MS))
+ }
+
+ armExpiryTimer()
+ return () => clearTimeout(timeoutId)
+ }, [isLogsAllDeprecationExpired])
+
+ const hasTrackedLogsAllExposure = useRef(false)
+ useEffect(() => {
+ if (!isLogsAllDeprecationLoaded || pathname == null) return
+
+ const shouldShow =
+ IS_PLATFORM &&
+ !isLogsAllDeprecationExpired &&
+ isLogsOrObservabilityPath(pathname) &&
+ !isLogsAllDeprecationDismissed
+
+ if (!shouldShow) {
+ dismissBanner(BANNER_ID.LOGS_ALL_DEPRECATION)
+ return
+ }
+
+ addBanner({
+ id: BANNER_ID.LOGS_ALL_DEPRECATION,
+ isDismissed: false,
+ content: <BannerLogsAllDeprecation />,
+ priority: 4,
+ })
+
+ if (!hasTrackedLogsAllExposure.current) {
+ hasTrackedLogsAllExposure.current = true
+ track('logs_all_deprecation_banner_exposed')
+ }
+ }, [
+ pathname,
+ isLogsAllDeprecationLoaded,
+ isLogsAllDeprecationDismissed,
+ isLogsAllDeprecationExpired,
+ addBanner,
+ dismissBanner,
+ track,
+ ])
+
return (
<div className="flex flex-col">
<div className="shrink-0">
diff --git a/apps/studio/components/interfaces/App/AppBannerWrapper.utils.ts b/apps/studio/components/interfaces/App/AppBannerWrapper.utils.ts
new file mode 100644
index 00000000000..2035a8d9bad
--- /dev/null
+++ b/apps/studio/components/interfaces/App/AppBannerWrapper.utils.ts
@@ -0,0 +1,8 @@
+// Anchored to the section root so per-resource log pages (e.g. a single edge
+// function's logs) don't pull the banner outside Logs/Observability.
+const LOGS_SECTION_PATH = /^\/project\/[^/]+\/(logs|observability)(\/|$)/
+
+export function isLogsOrObservabilityPath(pathname: string | null | undefined): boolean {
+ if (!pathname) return false
+ return LOGS_SECTION_PATH.test(pathname)
+}
diff --git a/apps/studio/components/ui/BannerStack/BannerStackProvider.test.tsx b/apps/studio/components/ui/BannerStack/BannerStackProvider.test.tsx
new file mode 100644
index 00000000000..0da73b822c9
--- /dev/null
+++ b/apps/studio/components/ui/BannerStack/BannerStackProvider.test.tsx
@@ -0,0 +1,78 @@
+import { act, renderHook } from '@testing-library/react'
+import { type PropsWithChildren } from 'react'
+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
+
+import { BANNER_ID, BannerStackProvider, useBannerStack } from './BannerStackProvider'
+
+const wrapper = ({ children }: PropsWithChildren) => (
+ <BannerStackProvider>{children}</BannerStackProvider>
+)
+
+describe('BannerStackProvider', () => {
+ beforeEach(() => {
+ vi.useFakeTimers()
+ })
+
+ afterEach(() => {
+ vi.useRealTimers()
+ })
+
+ it('keeps a banner that is revived before the dismiss animation finishes', () => {
+ const { result } = renderHook(() => useBannerStack(), { wrapper })
+
+ act(() => {
+ result.current.addBanner({
+ id: BANNER_ID.LOGS_ALL_DEPRECATION,
+ isDismissed: false,
+ content: null,
+ })
+ })
+
+ act(() => {
+ result.current.dismissBanner(BANNER_ID.LOGS_ALL_DEPRECATION)
+ })
+
+ act(() => {
+ result.current.addBanner({
+ id: BANNER_ID.LOGS_ALL_DEPRECATION,
+ isDismissed: false,
+ content: null,
+ })
+ })
+
+ act(() => {
+ vi.advanceTimersByTime(300)
+ })
+
+ expect(result.current.banners).toEqual([
+ expect.objectContaining({
+ id: BANNER_ID.LOGS_ALL_DEPRECATION,
+ isDismissed: false,
+ }),
+ ])
+ })
+
+ it('removes a banner after the dismiss animation when it stays dismissed', () => {
+ const { result } = renderHook(() => useBannerStack(), { wrapper })
+
+ act(() => {
+ result.current.addBanner({
+ id: BANNER_ID.LOGS_ALL_DEPRECATION,
+ isDismissed: false,
+ content: null,
+ })
+ })
+
+ act(() => {
+ result.current.dismissBanner(BANNER_ID.LOGS_ALL_DEPRECATION)
+ })
+
+ expect(result.current.banners[0]?.isDismissed).toBe(true)
+
+ act(() => {
+ vi.advanceTimersByTime(300)
+ })
+
+ expect(result.current.banners).toEqual([])
+ })
+})
diff --git a/apps/studio/components/ui/BannerStack/BannerStackProvider.tsx b/apps/studio/components/ui/BannerStack/BannerStackProvider.tsx
index 60615a56078..dc7fedb900a 100644
--- a/apps/studio/components/ui/BannerStack/BannerStackProvider.tsx
+++ b/apps/studio/components/ui/BannerStack/BannerStackProvider.tsx
@@ -7,6 +7,7 @@ export const BANNER_ID = {
RLS_EVENT_TRIGGER: 'rls-event-trigger-banner',
FREE_MICRO_UPGRADE: 'free-micro-upgrade-banner',
TOS_UPDATE: 'tos-update-banner',
+ LOGS_ALL_DEPRECATION: 'logs-all-deprecation-banner',
} as const
export type BannerId = (typeof BANNER_ID)[keyof typeof BANNER_ID]
@@ -47,7 +48,9 @@ export const BannerStackProvider = ({ children }: { children: React.ReactNode })
const dismissBanner = useCallback((id: string) => {
setBanners((prev) => prev.map((b) => (b.id === id ? { ...b, isDismissed: true } : b)))
setTimeout(() => {
- setBanners((prev) => prev.filter((b) => b.id !== id))
+ // A later addBanner can revive this id before the exit animation
+ // finishes. Drop it only if it is still dismissed.
+ setBanners((prev) => prev.filter((b) => b.id !== id || !b.isDismissed))
}, 300)
}, [])
diff --git a/apps/studio/components/ui/BannerStack/Banners/BannerLogsAllDeprecation.tsx b/apps/studio/components/ui/BannerStack/Banners/BannerLogsAllDeprecation.tsx
new file mode 100644
index 00000000000..4a8ebb66193
--- /dev/null
+++ b/apps/studio/components/ui/BannerStack/Banners/BannerLogsAllDeprecation.tsx
@@ -0,0 +1,49 @@
+import { LOCAL_STORAGE_KEYS } from 'common'
+import { Badge, Button } from 'ui'
+
+import { BannerCard } from '../BannerCard'
+import { BANNER_ID, useBannerStack } from '../BannerStackProvider'
+import { useLocalStorageQuery } from '@/hooks/misc/useLocalStorage'
+import { useTrack } from '@/lib/telemetry/track'
+
+const MIGRATION_GUIDE_URL =
+ 'https://supabase.com/changelog/48235-migration-of-supabase-management-api-logs-all-analytics-endpoint-to-logs-endpoint'
+
+export const BannerLogsAllDeprecation = () => {
+ const track = useTrack()
+ const { dismissBanner } = useBannerStack()
+
+ const [, setIsDismissed] = useLocalStorageQuery(
+ LOCAL_STORAGE_KEYS.LOGS_ALL_DEPRECATION_2026_09_23,
+ false
+ )
+
+ return (
+ <BannerCard
+ onDismiss={() => {
+ setIsDismissed(true)
+ dismissBanner(BANNER_ID.LOGS_ALL_DEPRECATION)
+ track('logs_all_deprecation_banner_dismiss_button_clicked')
+ }}
+ >
+ <div className="flex flex-col gap-y-2">
+ <Badge variant="default" className="w-min -ml-0.5 uppercase inline-flex items-center mb-2">
+ Notice
+ </Badge>
+
+ <div className="flex flex-col gap-y-1 mb-2">
+ <p className="text-sm font-medium">Logs endpoint retires September 23</p>
+ <p className="text-xs text-foreground-lighter text-balance">
+ Scripts that call the <code className="text-code-inline break-keep!">logs.all</code>{' '}
+ Management API endpoint need to migrate. Dashboard logs are unchanged.
+ </p>
+ </div>
+ <Button variant="default" size="tiny" className="w-min" asChild>
+ <a href={MIGRATION_GUIDE_URL} target="_blank" rel="noreferrer noopener">
+ Learn more
+ </a>
+ </Button>
+ </div>
+ </BannerCard>
+ )
+}
diff --git a/apps/studio/tests/components/interfaces/App/AppBannerWrapper.utils.test.ts b/apps/studio/tests/components/interfaces/App/AppBannerWrapper.utils.test.ts
new file mode 100644
index 00000000000..12716cda236
--- /dev/null
+++ b/apps/studio/tests/components/interfaces/App/AppBannerWrapper.utils.test.ts
@@ -0,0 +1,28 @@
+import { describe, expect, test } from 'vitest'
+
+import { isLogsOrObservabilityPath } from '@/components/interfaces/App/AppBannerWrapper.utils'
+
+describe('isLogsOrObservabilityPath', () => {
+ test.each([
+ '/project/abc/logs',
+ '/project/abc/logs/',
+ '/project/abc/logs/explorer',
+ '/project/abc/observability',
+ '/project/abc/observability/query-performance',
+ ])('matches %s', (pathname) => {
+ expect(isLogsOrObservabilityPath(pathname)).toBe(true)
+ })
+
+ test.each([
+ undefined,
+ null,
+ '',
+ '/project/abc',
+ '/project/abc/editor',
+ '/project/abc/logs-explorer',
+ '/project/abc/functions/my-fn/logs',
+ '/org/abc/logs',
+ ])('does not match %s', (pathname) => {
+ expect(isLogsOrObservabilityPath(pathname)).toBe(false)
+ })
+})
diff --git a/packages/common/constants/local-storage.ts b/packages/common/constants/local-storage.ts
index 91a6e9fc30a..70bffe0cdf5 100644
--- a/packages/common/constants/local-storage.ts
+++ b/packages/common/constants/local-storage.ts
@@ -121,6 +121,8 @@ export const LOCAL_STORAGE_KEYS = {
`project-upgrade-failed-banner-dismissed-at-${ref}`,
UNIFIED_LOGS_BANNER_DISMISSED: 'unified-logs-banner-dismissed',
UNIFIED_LOGS_SIDEBAR_BANNER_DISMISSED: 'unified-logs-sidebar-banner-dismissed',
+ // Dated so the key retires with the banner; see BannerLogsAllDeprecation
+ LOGS_ALL_DEPRECATION_2026_09_23: 'logs-all-deprecation-2026-09-23-dismissed',
SCOPED_TOKENS_MIGRATION_ADMONITION_DISMISSED: 'scoped-tokens-migration-admonition-dismissed',
STORAGE_PUBLIC_BUCKET_SELECT_POLICY_WARNING_DISMISSED: (ref: string, bucketId: string) =>
`storage-public-bucket-select-policy-warning-dismissed-${ref}-${bucketId}`,
diff --git a/packages/common/telemetry-constants.ts b/packages/common/telemetry-constants.ts
index 9596095bcaa..14feba7fab0 100644
--- a/packages/common/telemetry-constants.ts
+++ b/packages/common/telemetry-constants.ts
@@ -1427,6 +1427,32 @@ export interface UnifiedLogsBannerDismissButtonClickedEvent {
groups: TelemetryGroups
}
+/**
+ * The logs.all deprecation banner was rendered, fired once per mount. Acts as the
+ * denominator for the dismiss rate. Migration outcome itself is measured via decay in
+ * `/v1/projects/:ref/analytics/endpoints/logs.all` traffic in the warehouse, not from this event.
+ *
+ * @group Events
+ * @source studio
+ * @page /project/[ref]/logs/*, /project/[ref]/observability/*
+ */
+export interface LogsAllDeprecationBannerExposedEvent {
+ action: 'logs_all_deprecation_banner_exposed'
+ groups: TelemetryGroups
+}
+
+/**
+ * User dismissed the logs.all deprecation banner.
+ *
+ * @group Events
+ * @source studio
+ * @page /project/[ref]/logs/*, /project/[ref]/observability/*
+ */
+export interface LogsAllDeprecationBannerDismissButtonClickedEvent {
+ action: 'logs_all_deprecation_banner_dismiss_button_clicked'
+ groups: TelemetryGroups
+}
+
/**
* User clicked the enable button for Index Advisor, either from the banner or the confirmation dialog.
*
@@ -3783,6 +3809,8 @@ export type TelemetryEvent =
| ReportsDatabaseGrafanaBannerClickedEvent
| UnifiedLogsBannerCtaButtonClickedEvent
| UnifiedLogsBannerDismissButtonClickedEvent
+ | LogsAllDeprecationBannerExposedEvent
+ | LogsAllDeprecationBannerDismissButtonClickedEvent
| IndexAdvisorEnableButtonClickedEvent
| IndexAdvisorBannerDismissButtonClickedEvent
| IndexAdvisorTabClickedEvent