From d314172b981855d78f326145d345272e485392b6 Mon Sep 17 00:00:00 2001 From: Luke Mino-Altherr Date: Wed, 3 Dec 2025 19:19:14 -0800 Subject: [PATCH] [feat] Add remote config support for model upload and asset update feature flags (#7143) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Feature flags for model upload button and asset update options now check remote config from `/api/features` first, falling back to websocket feature flags. - **What**: Added `model_upload_button_enabled` and `asset_update_options_enabled` to `RemoteConfig` type - **What**: Updated feature flag getters to prioritize remote config over websocket flags - **Why**: Enables dynamic feature control without requiring websocket connection, consistent with other feature flags pattern - Pattern consistency with other remote config feature flags - Proper fallback behavior when remote config is unavailable ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7143-feat-Add-remote-config-support-for-model-upload-and-asset-update-feature-flags-2bf6d73d3650819cb364f0ab69d77dd0) by [Unito](https://www.unito.io) Co-authored-by: Claude --- src/composables/useFeatureFlags.ts | 24 ++++++++++++++++++++---- src/platform/remoteConfig/types.ts | 5 +++++ 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/composables/useFeatureFlags.ts b/src/composables/useFeatureFlags.ts index 643bb103ff..de8c859124 100644 --- a/src/composables/useFeatureFlags.ts +++ b/src/composables/useFeatureFlags.ts @@ -1,5 +1,6 @@ import { computed, reactive, readonly } from 'vue' +import { remoteConfig } from '@/platform/remoteConfig/remoteConfig' import { api } from '@/scripts/api' /** @@ -9,7 +10,8 @@ export enum ServerFeatureFlag { SUPPORTS_PREVIEW_METADATA = 'supports_preview_metadata', MAX_UPLOAD_SIZE = 'max_upload_size', MANAGER_SUPPORTS_V4 = 'extension.manager.supports_v4', - MODEL_UPLOAD_BUTTON_ENABLED = 'model_upload_button_enabled' + MODEL_UPLOAD_BUTTON_ENABLED = 'model_upload_button_enabled', + ASSET_UPDATE_OPTIONS_ENABLED = 'asset_update_options_enabled' } /** @@ -27,9 +29,23 @@ export function useFeatureFlags() { return api.getServerFeature(ServerFeatureFlag.MANAGER_SUPPORTS_V4) }, get modelUploadButtonEnabled() { - return api.getServerFeature( - ServerFeatureFlag.MODEL_UPLOAD_BUTTON_ENABLED, - false + // Check remote config first (from /api/features), fall back to websocket feature flags + return ( + remoteConfig.value.model_upload_button_enabled ?? + api.getServerFeature( + ServerFeatureFlag.MODEL_UPLOAD_BUTTON_ENABLED, + false + ) + ) + }, + get assetUpdateOptionsEnabled() { + // Check remote config first (from /api/features), fall back to websocket feature flags + return ( + remoteConfig.value.asset_update_options_enabled ?? + api.getServerFeature( + ServerFeatureFlag.ASSET_UPDATE_OPTIONS_ENABLED, + false + ) ) } }) diff --git a/src/platform/remoteConfig/types.ts b/src/platform/remoteConfig/types.ts index 43bfbd70fe..8d2c400f37 100644 --- a/src/platform/remoteConfig/types.ts +++ b/src/platform/remoteConfig/types.ts @@ -1,3 +1,5 @@ +import type { TelemetryEventName } from '@/platform/telemetry/types' + /** * Server health alert configuration from the backend */ @@ -31,4 +33,7 @@ export type RemoteConfig = { comfy_api_base_url?: string comfy_platform_base_url?: string firebase_config?: FirebaseRuntimeConfig + telemetry_disabled_events?: TelemetryEventName[] + model_upload_button_enabled?: boolean + asset_update_options_enabled?: boolean }