mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-03 22:59:14 +00:00
[bugfix] Fix invalid ManagerChannel enum value in nodepack installation (#5312)
* [bugfix] Fix invalid ManagerChannel enum value in nodepack installation Fix nodepack installation failure caused by using 'stable' channel value which is not defined in the ManagerChannel enum. Changed from 'stable' to 'default' which is a valid enum value according to the backend schema. Fixes nodepack installation requests that were failing validation at /v2/manager/queue/task endpoint. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * [refactor] Enforce type safety for enum values without type assertions Remove type assertions (as ManagerChannel) and use explicit Record typing to ensure compile-time validation of enum values. This prevents invalid enum values from being used by catching them during TypeScript compilation rather than runtime validation failures. - Replace type assertions with Record<string, ManagerChannel> typing - Remove manual casting that bypassed TypeScript's type checking - Ensure invalid enum values cause compilation errors --------- Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -109,15 +109,15 @@ const SelectedVersionValues = {
|
||||
NIGHTLY: 'nightly' as SelectedVersion
|
||||
}
|
||||
|
||||
const ManagerChannelValues = {
|
||||
STABLE: 'stable' as ManagerChannel,
|
||||
DEV: 'dev' as ManagerChannel
|
||||
const ManagerChannelValues: Record<string, ManagerChannel> = {
|
||||
DEFAULT: 'default', // ✅ Valid - will compile
|
||||
DEV: 'dev' // ✅ Valid - will compile
|
||||
}
|
||||
|
||||
const ManagerDatabaseSourceValues = {
|
||||
CACHE: 'cache' as ManagerDatabaseSource,
|
||||
REMOTE: 'remote' as ManagerDatabaseSource,
|
||||
LOCAL: 'local' as ManagerDatabaseSource
|
||||
const ManagerDatabaseSourceValues: Record<string, ManagerDatabaseSource> = {
|
||||
CACHE: 'cache',
|
||||
REMOTE: 'remote',
|
||||
LOCAL: 'local'
|
||||
}
|
||||
|
||||
const { nodePack } = defineProps<{
|
||||
@@ -242,7 +242,7 @@ const handleSubmit = async () => {
|
||||
await managerStore.installPack.call({
|
||||
id: nodePack.id,
|
||||
repository: nodePack.repository ?? '',
|
||||
channel: ManagerChannelValues.STABLE,
|
||||
channel: ManagerChannelValues.DEFAULT,
|
||||
mode: ManagerDatabaseSourceValues.CACHE,
|
||||
version: actualVersion,
|
||||
selected_version: selectedVersion.value
|
||||
|
||||
Reference in New Issue
Block a user