-
Notifications
You must be signed in to change notification settings - Fork 406
[bugfix] Fix invalid ManagerChannel enum value in nodepack installation #5312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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 <[email protected]>
🎭 Playwright Test Results✅ All tests passed across all browsers! ⏰ Completed at: 09/03/2025, 04:30:52 AM UTC 📊 Test Reports by Browser🎉 Your tests are passing across all browsers! |
viva-jinyi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
| const ManagerChannelValues = { | ||
| STABLE: 'stable' as ManagerChannel, | ||
| DEFAULT: 'default' as ManagerChannel, | ||
| DEV: 'dev' as ManagerChannel | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We switched to API-driven design where there is a single source of truth (the openapi spec) which then generates TS types and Pydantic models and both client and server use those types. We should try to actually enforce the string enum type from those types here instead of defining our own enum inside the component (because it can allow for the exact type of error this PR is trying to resolve).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed to
const ManagerChannelValues: Record<string, ManagerChannel> = {
DEFAULT: 'default', // ✅ Compile-time validation
DEV: 'dev' // ✅ TypeScript catches invalid values
}This ensures that future developers can't accidentally introduce invalid enum values - TypeScript will catch them during development rather than causing runtime API validation failures.
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
|
Oops forgot to remove comments, will do in followup. |
Summary
Problem
Nodepack installations were failing validation at the
/v2/manager/queue/taskendpoint because the frontend was sendingchannel: 'stable'but the backend ManagerChannel enum only accepts:'default' | 'recent' | 'legacy' | 'forked' | 'dev' | 'tutorial'.After, switching versions works again from the version selection popover
┆Issue is synchronized with this Notion page by Unito