Skip to content

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

Add feature flag to disable /chore requests trigger in CreateBranchModal (#38461)

Joshen Lim31ad637e9e3e
diff --git a/apps/studio/components/interfaces/BranchManagement/CreateBranchModal.tsx b/apps/studio/components/interfaces/BranchManagement/CreateBranchModal.tsx
index f85465f7c16..9ffa0387be7 100644
--- a/apps/studio/components/interfaces/BranchManagement/CreateBranchModal.tsx
+++ b/apps/studio/components/interfaces/BranchManagement/CreateBranchModal.tsx
@@ -63,6 +63,9 @@ export const CreateBranchModal = () => {
const gitlessBranching = useIsBranching2Enabled()
const allowDataBranching = useFlag('allowDataBranching')
+ // [Joshen] This is meant to be short lived while we're figuring out how to control
+ // requests to this endpoint. Kill switch in case we need to stop the requests
+ const disableBackupsCheck = useFlag('disableBackupsCheckInCreatebranchmodal')
const isProPlanAndUp = selectedOrg?.plan?.id !== 'free'
const promptProPlanUpgrade = IS_PLATFORM && !isProPlanAndUp
@@ -93,7 +96,7 @@ export const CreateBranchModal = () => {
{ projectRef },
{
// [Joshen] Only trigger this request when the modal is opened
- enabled: showCreateBranchModal,
+ enabled: showCreateBranchModal && !disableBackupsCheck,
}
)
const targetVolumeSizeGb = cloneBackups?.target_volume_size_gb ?? 0
@@ -364,13 +367,13 @@ export const CreateBranchModal = () => {
<TooltipTrigger>
<FormControl_Shadcn_>
<Switch
- disabled={noPhysicalBackups}
+ disabled={!disableBackupsCheck && noPhysicalBackups}
checked={field.value}
onCheckedChange={field.onChange}
/>
</FormControl_Shadcn_>
</TooltipTrigger>
- {noPhysicalBackups && (
+ {!disableBackupsCheck && noPhysicalBackups && (
<TooltipContent side="bottom">
PITR is required for the project to clone data into the branch
</TooltipContent>