mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2026-11-04 23:37:31 +00:00
[PR #3364] fix(custom-nodes-manager): show CNR update badge only when the registry version is actually newer #3234
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/ComfyUI-Manager#3234
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Comfy-Org/ComfyUI-Manager/pull/3364
Author: @zhaoruizhe81
Created: 10/10/2026
Status: 🔄 Open
Base:
main← Head:fix/cnr-version-semantic-compare📝 Commits (1)
22f8e9bfix(custom-nodes-manager): show CNR update badge only when the registry version is actually newer📊 Changes
2 files changed (+176 additions, -1 deletions)
View changed files
📝
js/custom-nodes-manager.js(+29 -1)➕
tests/test_version_badge_semver.py(+147 -0)📄 Description
What
The Custom Nodes Manager's Version column decided whether to render the
[↑x.y.z]update badge with a bare string inequality(
js/custom-nodes-manager.js:755):String comparison says
"1.47.0" != "1.78.1", so a node installed at1.78.1 was shown as updatable to 1.47.0 (#3272). The backend has been
comparing correctly all along —
is_updatableinglob/manager_core.pyuses
packagingversions viasafe_version.This PR adds a small module-level helper,
compareVersionSpecs(a, b), thatcompares dot-separated numeric specs (returns 1 / -1 / 0, or
nullwheneither side is not fully numeric), and gates the
↑badge on the registryversion being provably newer (
cmp === 1). Thenightlybranch isuntouched. When the helper cannot parse a spec it returns
nulland theformatter keeps the legacy string behavior, so exotic version strings behave
exactly as before.
Two side effects worth noting:
glob/manager_core.py:895injectscnr_latest = '0.0.0'when the registryhas no
latest_version. Under the old string compare that rendered anonsensical
[↑0.0.0]badge; under the new compare it correctly renders none.installNodeWithVersion(line 1361) usescnr_latest != active_versionto decide whether to offerlatestin the versionselector. Intentionally left unchanged: for an install that is newer
than the registry (exactly #3272's case), that entry is the user's
downgrade path back to the registry's active version. Making it
semver-aware would silently remove that option — happy to follow up
separately if maintainers want it.
Also adds
tests/test_version_badge_semver.py, following the existingtests/js_lift.pylift-and-execute pattern used bytest_pack_column_escaping.py/test_grid_highlight_escaping.py.Why
#3272, confirmed in the comments: the semantic-version comparison problem is
valid (the example node additionally has a separate registry-status issue
tracked in registry-backend#233, which this PR does not address). A locally
newer install must not be flagged as outdated.
How verified
1. Lifted the shipped formatter verbatim (the
tests/js_lift.pyapproach)and executed it in node, before and after the patch — same 9-case matrix
both sides:
Before (
git show main:js/custom-nodes-manager.js), 3 failures — exactly thereported bug plus two siblings:
After the patch, all 9 pass — 1.78.1/1.47.0 no badge; 1.0.0/1.47.0 badge
kept; equal versions no badge; the
0.0.0sentinel no badge;1.2vs1.10.0compared numerically both ways; thenightlybranch outputbyte-identical; unparseable specs (
1.2.3rc1) keep legacy behavior.2. The new test file reproduces RED -> GREEN:
3. Existing tests and lint are untouched:
python -m pytest tests/→239 passed, 80 skipped (the skips are the
E2E_ROOT-gated e2e suite); thejs_lift suites (
test_pack_column_escaping.py,test_grid_highlight_escaping.py) pass unchanged;ruff check .clean.Fixes #3272
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.