mirror of
https://github.com/supabase/supabase.git
synced 2026-10-08 02:45:07 +03:00
## What Disable the Unified Logs feature on self-hosted Studio (`IS_PLATFORM=false`), where there is no backend to support it. Fixes [FE-3747](https://linear.app/supabase/issue/FE-3747). ## Why Unified logs is platform-only. A provider-level guard already forces the `isPlatformOnly` preview flag off on self-hosted, but two gaps let the feature still surface: 1. The logs sidebar renders `<UnifiedLogsBanner />` unconditionally, so self-hosted users saw an **"Enable preview"** button. Clicking it wrote the preview flag to local storage and routed to `/logs`, transiently rendering the unified logs UI. 2. `useUnifiedLogsPreview` derived `isDefaultOptIn` purely from the `unifiedLogsDefaultOptIn` feature flag, with no platform check. ## Changes - `UnifiedLogsBanner` returns `null` when `!IS_PLATFORM`, removing the only entry point to enable the preview on self-hosted. - `useUnifiedLogsPreview` gates both `isEnabled` and `isDefaultOptIn` on `IS_PLATFORM`, making the hook authoritative so no flag/local-storage state can enable unified logs on self-hosted. ## Tests - `FeaturePreviewContext.selfhosted.test.tsx` — the hook never reports unified logs as enabled or default-opt-in on self-hosted, even with the feature flags on. - `UnifiedLogsBanner.selfhosted.test.tsx` — the banner renders nothing on self-hosted. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Restricted Unified Logs preview and banner availability to supported platform environments. * Prevented unsupported environments from displaying the Unified Logs banner or opting in by default. <!-- end of auto-generated comment: release notes by coderabbit.ai -->