Skip to content

Commit 52e915b

Browse files
[feat] Add remote config support for model upload and asset update feature flags (#7143)
## Summary Feature flags for model upload button and asset update options now check remote config from `/api/features` first, falling back to websocket feature flags. ## Changes - **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 ## Review Focus - 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 <noreply@anthropic.com>
1 parent 643533c commit 52e915b

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

src/composables/useFeatureFlags.ts

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { computed, reactive, readonly } from 'vue'
22

3+
import { remoteConfig } from '@/platform/remoteConfig/remoteConfig'
34
import { api } from '@/scripts/api'
45

56
/**
@@ -28,15 +29,23 @@ export function useFeatureFlags() {
2829
return api.getServerFeature(ServerFeatureFlag.MANAGER_SUPPORTS_V4)
2930
},
3031
get modelUploadButtonEnabled() {
31-
return api.getServerFeature(
32-
ServerFeatureFlag.MODEL_UPLOAD_BUTTON_ENABLED,
33-
false
32+
// Check remote config first (from /api/features), fall back to websocket feature flags
33+
return (
34+
remoteConfig.value.model_upload_button_enabled ??
35+
api.getServerFeature(
36+
ServerFeatureFlag.MODEL_UPLOAD_BUTTON_ENABLED,
37+
false
38+
)
3439
)
3540
},
3641
get assetUpdateOptionsEnabled() {
37-
return api.getServerFeature(
38-
ServerFeatureFlag.ASSET_UPDATE_OPTIONS_ENABLED,
39-
false
42+
// Check remote config first (from /api/features), fall back to websocket feature flags
43+
return (
44+
remoteConfig.value.asset_update_options_enabled ??
45+
api.getServerFeature(
46+
ServerFeatureFlag.ASSET_UPDATE_OPTIONS_ENABLED,
47+
false
48+
)
4049
)
4150
}
4251
})

src/platform/remoteConfig/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,6 @@ export type RemoteConfig = {
3434
comfy_platform_base_url?: string
3535
firebase_config?: FirebaseRuntimeConfig
3636
telemetry_disabled_events?: TelemetryEventName[]
37+
model_upload_button_enabled?: boolean
38+
asset_update_options_enabled?: boolean
3739
}

0 commit comments

Comments
 (0)