mirror of
https://github.com/supabase/supabase.git
synced 2026-10-13 13:19:09 +03:00
## What kind of change does this PR introduce? Feature, limited to staging and local. ## What is the current behavior? On High Availability projects, Studio always disables Realtime: the Realtime pages and the Publications pages show an "unavailable" message, the table editor's "Enable Realtime" checkbox is disabled, and the project home shows Realtime as disabled. ## What is the new behavior? A new `useIsRealtimeUnavailable()` hook treats Realtime as unavailable only on High Availability projects outside staging and local (via `IS_STAGING_OR_LOCAL`). Those four places use it instead of checking `high_availability` directly. - **Production:** unchanged. - **Staging and local:** Realtime behaves as on standard projects. ## Additional context Whether a High Availability project is actually registered as a Realtime tenant is gated separately on the platform side. Until then, the pages render but Realtime connections for that project fail. Tests: a new `resolveRealtimeUnavailable` test, and the `TableRealtimeToggle` and `resolveRealtimeServiceStatus` tests updated for the renamed parameter.
15 lines
554 B
TypeScript
15 lines
554 B
TypeScript
import { describe, expect, it } from 'vitest'
|
|
|
|
import { resolveRealtimeServiceStatus } from './ServiceStatus.utils'
|
|
|
|
describe('resolveRealtimeServiceStatus', () => {
|
|
it('marks Realtime as disabled when it is unavailable', () => {
|
|
expect(resolveRealtimeServiceStatus(true, 'UNHEALTHY')).toBe('DISABLED')
|
|
})
|
|
|
|
it('preserves Realtime health when it is available', () => {
|
|
expect(resolveRealtimeServiceStatus(false, 'ACTIVE_HEALTHY')).toBe('ACTIVE_HEALTHY')
|
|
expect(resolveRealtimeServiceStatus(false, 'UNHEALTHY')).toBe('UNHEALTHY')
|
|
})
|
|
})
|