From 35f5773deb7be73dc18acab7ca0679afe0a99ca6 Mon Sep 17 00:00:00 2001 From: Christian Byrne Date: Tue, 2 Sep 2025 22:55:17 -0700 Subject: [PATCH] [bugfix] Fix invalid ManagerChannel enum value in nodepack installation (#5312) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [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 * [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 typing - Remove manual casting that bypassed TypeScript's type checking - Ensure invalid enum values cause compilation errors --------- Co-authored-by: Claude --- .../manager/PackVersionSelectorPopover.vue | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/dialog/content/manager/PackVersionSelectorPopover.vue b/src/components/dialog/content/manager/PackVersionSelectorPopover.vue index 3bc6094eb..b6eba95be 100644 --- a/src/components/dialog/content/manager/PackVersionSelectorPopover.vue +++ b/src/components/dialog/content/manager/PackVersionSelectorPopover.vue @@ -109,15 +109,15 @@ const SelectedVersionValues = { NIGHTLY: 'nightly' as SelectedVersion } -const ManagerChannelValues = { - STABLE: 'stable' as ManagerChannel, - DEV: 'dev' as ManagerChannel +const ManagerChannelValues: Record = { + 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 = { + 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