-
Notifications
You must be signed in to change notification settings - Fork 372
Fix version detection for disabled packs #5395
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
🎭 Playwright Test Results✅ All tests passed across all browsers! ⏰ Completed at: 09/07/2025, 05:20:19 AM UTC 📊 Test Reports by Browser🎉 Your tests are passing across all browsers! |
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!
be45523
to
104c06c
Compare
}) | ||
|
||
// Version suffixed keys should not exist | ||
expect(installedPacks.value['ComfyUI-GGUF@1_1_4']).toBeUndefined() |
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.
In this case, the string could be anything other than the two values above, right?
} | ||
} | ||
|
||
;(mockManagerService.listInstalledPacks as any).mockResolvedValue( |
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.
Could you use vi.mocked
to avoid as any
?
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.
Agree with needs for tests for packUtils.ts
Otherwise I like it.
fe51ae5
When a pack is disabled, ComfyUI-Manager returns it with a version suffix (e.g., "ComfyUI-GGUF@1_1_4") while enabled packs don't have this suffix. This inconsistency caused disabled packs to incorrectly show as having updates available even when they were on the latest version. Changes: - Add normalizePackId utility to consistently remove version suffixes - Apply normalization in refreshInstalledList and WebSocket updates - Use the utility across conflict detection and node help modules - Ensure pack version info is preserved in the object's ver field This fixes the "Update Available" indicator incorrectly showing for disabled packs that are already on the latest version. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
improvements - Remove unnecessary .not.toThrow() assertion in useManagerQueue test - Add clarifying comments for version normalization test logic - Replace 'as any' with vi.mocked() for better type safety
9239995
to
1bc6944
Compare
* fix: normalize pack IDs to fix version detection for disabled packs When a pack is disabled, ComfyUI-Manager returns it with a version suffix (e.g., "ComfyUI-GGUF@1_1_4") while enabled packs don't have this suffix. This inconsistency caused disabled packs to incorrectly show as having updates available even when they were on the latest version. Changes: - Add normalizePackId utility to consistently remove version suffixes - Apply normalization in refreshInstalledList and WebSocket updates - Use the utility across conflict detection and node help modules - Ensure pack version info is preserved in the object's ver field This fixes the "Update Available" indicator incorrectly showing for disabled packs that are already on the latest version. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * feature: test code added * test: packUtils test code added * test: address PR review feedback for test improvements - Remove unnecessary .not.toThrow() assertion in useManagerQueue test - Add clarifying comments for version normalization test logic - Replace 'as any' with vi.mocked() for better type safety --------- Co-authored-by: Claude <[email protected]>
@viva-jinyi Successfully backported to #5416 |
expect(normalizePackId('@1_0_0')).toBe('') | ||
|
||
// Whitespace | ||
expect(normalizePackId(' pack @1_0_0')).toBe(' pack ') |
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.
Is this what we want?
Do we allow for significant leading and trailing whitespace?
it('should handle edge cases', () => { | ||
// Only @ symbol | ||
expect(normalizePackId('@')).toBe('') | ||
expect(normalizePackId('@1_0_0')).toBe('') |
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.
These feel like they should error out.
Wouldn't this put the item into the map keyed in empty string?
expect(normalizePackKeys(input)).toEqual(expected) | ||
}) | ||
|
||
it('should work with different value types', () => { |
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.
Shouldn't we enforce that this is pack specific? When would we want to normalize the key to map to null?
}) | ||
}) | ||
|
||
describe('normalizePackKeys', () => { |
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.
The duplication here makes me think that one of these methods should be private, probably the ID normalization, and that the public contract to test would just be this one.
// but there should only be one 'pack' key in the result | ||
expect(Object.keys(result)).toEqual(['pack']) | ||
expect(result.pack).toBeDefined() | ||
expect(result.pack.ver).toBeDefined() |
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.
If the last one wins this would be '3.0.0'?
* fix: normalize pack IDs to fix version detection for disabled packs When a pack is disabled, ComfyUI-Manager returns it with a version suffix (e.g., "ComfyUI-GGUF@1_1_4") while enabled packs don't have this suffix. This inconsistency caused disabled packs to incorrectly show as having updates available even when they were on the latest version. Changes: - Add normalizePackId utility to consistently remove version suffixes - Apply normalization in refreshInstalledList and WebSocket updates - Use the utility across conflict detection and node help modules - Ensure pack version info is preserved in the object's ver field This fixes the "Update Available" indicator incorrectly showing for disabled packs that are already on the latest version. 🤖 Generated with [Claude Code](https://claude.ai/code) * feature: test code added * test: packUtils test code added * test: address PR review feedback for test improvements - Remove unnecessary .not.toThrow() assertion in useManagerQueue test - Add clarifying comments for version normalization test logic - Replace 'as any' with vi.mocked() for better type safety --------- Co-authored-by: Jin Yi <[email protected]> Co-authored-by: Claude <[email protected]>
* fix: normalize pack IDs to fix version detection for disabled packs When a pack is disabled, ComfyUI-Manager returns it with a version suffix (e.g., "ComfyUI-GGUF@1_1_4") while enabled packs don't have this suffix. This inconsistency caused disabled packs to incorrectly show as having updates available even when they were on the latest version. Changes: - Add normalizePackId utility to consistently remove version suffixes - Apply normalization in refreshInstalledList and WebSocket updates - Use the utility across conflict detection and node help modules - Ensure pack version info is preserved in the object's ver field This fixes the "Update Available" indicator incorrectly showing for disabled packs that are already on the latest version. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * feature: test code added * test: packUtils test code added * test: address PR review feedback for test improvements - Remove unnecessary .not.toThrow() assertion in useManagerQueue test - Add clarifying comments for version normalization test logic - Replace 'as any' with vi.mocked() for better type safety --------- Co-authored-by: Claude <[email protected]>
Summary
Problem
When a pack is disabled, ComfyUI-Manager returns it with a version suffix (e.g.,
ComfyUI-GGUF@1_1_4
) while enabled packs don't have this suffix. This inconsistency caused:Solution
Created a
normalizePackId
utility function that:ver
fieldChanges
src/utils/packUtils.ts
with normalization utilitiescomfyManagerStore
to normalize pack keysuseManagerQueue
to normalize WebSocket pack dataTest Plan
🤖 Generated with Claude Code
┆Issue is synchronized with this Notion page by Unito