Skip to content

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

Remove feature flag for RLS tester (#45332)

Joshen Lim89d08a2505de
diff --git a/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewContext.tsx b/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewContext.tsx
index b12a2a67c4d..ea7ac88e49e 100644
--- a/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewContext.tsx
+++ b/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewContext.tsx
@@ -127,9 +127,7 @@ export const useIsJitDbAccessEnabled = () => {
export const useIsRLSTesterEnabled = () => {
const { flags } = useFeaturePreviewContext()
- const rlsTesterEnabled = useFlag('rlsTester')
-
- return rlsTesterEnabled && flags[LOCAL_STORAGE_KEYS.UI_PREVIEW_RLS_TESTER]
+ return flags[LOCAL_STORAGE_KEYS.UI_PREVIEW_RLS_TESTER]
}
export const useFeaturePreviewModal = () => {
diff --git a/apps/studio/components/interfaces/App/FeaturePreview/useFeaturePreviews.ts b/apps/studio/components/interfaces/App/FeaturePreview/useFeaturePreviews.ts
index 84a19a214fd..b438fc92ecc 100644
--- a/apps/studio/components/interfaces/App/FeaturePreview/useFeaturePreviews.ts
+++ b/apps/studio/components/interfaces/App/FeaturePreview/useFeaturePreviews.ts
@@ -22,14 +22,13 @@ export const useFeaturePreviews = (): FeaturePreview[] => {
const pgDeltaDiffEnabled = useFlag('pgdeltaDiff')
const platformWebhooksEnabled = useFlag('platformWebhooks')
const jitDbAccessEnabled = useFlag('jitDbAccess')
- const rlsTesterEnabled = useFlag('rlsTester')
return [
{
key: LOCAL_STORAGE_KEYS.UI_PREVIEW_RLS_TESTER,
name: 'RLS Tester',
discussionsUrl: 'https://github.com/orgs/supabase/discussions/45233',
- enabled: rlsTesterEnabled,
+ enabled: true,
isNew: true,
isPlatformOnly: false,
isDefaultOptIn: false,
diff --git a/apps/studio/components/interfaces/Auth/RLSTester/UserSelector.tsx b/apps/studio/components/interfaces/Auth/RLSTester/UserSelector.tsx
index f92c9d91823..a9c3bdc46b8 100644
--- a/apps/studio/components/interfaces/Auth/RLSTester/UserSelector.tsx
+++ b/apps/studio/components/interfaces/Auth/RLSTester/UserSelector.tsx
@@ -91,12 +91,12 @@ export const UserSelector = () => {
onValueChange={setSearchText}
/>
- <CommandEmpty_Shadcn_>No user found</CommandEmpty_Shadcn_>
-
- {isError && (
+ {isError ? (
<Admonition showIcon={false} type="warning" className="border-0 rounded-none text-xs">
Failed to fetch users: {error.message}
</Admonition>
+ ) : (
+ <CommandEmpty_Shadcn_>No user found</CommandEmpty_Shadcn_>
)}
<CommandList_Shadcn_>
diff --git a/apps/studio/pages/project/[ref]/auth/policies.tsx b/apps/studio/pages/project/[ref]/auth/policies.tsx
index a22729d6840..c9850e38bb3 100644
--- a/apps/studio/pages/project/[ref]/auth/policies.tsx
+++ b/apps/studio/pages/project/[ref]/auth/policies.tsx
@@ -1,6 +1,6 @@
import type { PostgresPolicy, PostgresTable } from '@supabase/postgres-meta'
import { PermissionAction } from '@supabase/shared-types/out/constants'
-import { LOCAL_STORAGE_KEYS, useFlag, useParams } from 'common'
+import { LOCAL_STORAGE_KEYS, useParams } from 'common'
import { Search, X } from 'lucide-react'
import { parseAsBoolean, parseAsString, useQueryState } from 'nuqs'
import { useCallback, useDeferredValue, useEffect, useMemo, useState } from 'react'
@@ -115,7 +115,6 @@ const AuthPoliciesPage: NextPageWithLayout = () => {
const isInlineEditorEnabled = useIsInlineEditorEnabled()
const rlsTesterEnabled = useIsRLSTesterEnabled()
- const rlsTesterVisible = useFlag('rlsTester')
const { openSidebar } = useSidebarManagerSnapshot()
const {
@@ -237,7 +236,7 @@ const AuthPoliciesPage: NextPageWithLayout = () => {
const handleResetSearch = useCallback(() => setSearchString(''), [setSearchString])
useEffect(() => {
- if (!rlsTesterVisible || rlsTesterEnabled) return
+ if (rlsTesterEnabled) return
if (!isRlsTesterBannerDismissed) {
addBanner({
@@ -253,7 +252,7 @@ const AuthPoliciesPage: NextPageWithLayout = () => {
return () => {
dismissBanner('rls-tester-banner')
}
- }, [addBanner, dismissBanner, isRlsTesterBannerDismissed, rlsTesterEnabled, rlsTesterVisible])
+ }, [addBanner, dismissBanner, isRlsTesterBannerDismissed, rlsTesterEnabled])
useEffect(() => {
if (!isTriggerPermissionsLoaded) return