ComfyUI/tests-unit/app_test
Jedrzej Kosinski 2ff1d3d042 fix: make NodeReplaceManager.register() idempotent
When the same (old_node_id, new_node_id) pair is registered more than
once in the same process, the duplicate is now silently ignored (with a
debug log). Previously every call appended a new entry, so reloading a
custom node — e.g. via ComfyUI-Manager hot-reload — would accumulate
stale duplicate replacements that surfaced through GET /node_replacements.

Multiple distinct alternatives for the same old_node_id (different
new_node_ids) are still preserved, matching the existing 'list of
alternatives' design used by apply_replacements().

Adds unit tests in tests-unit/app_test/node_replace_manager_test.py
covering normal registration, multi-alternative support, dedupe, and
first-write-wins ordering.

Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019dd37c-4751-72ef-9927-3182b5825db0
2026-04-28 03:03:41 -07:00
..
__init__.py Add FrontendManager to manage non-default front-end impl (#3897) 2024-07-16 11:26:11 -04:00
custom_node_manager_test.py [i18n] Add /i18n endpoint to provide all custom node translations (#6558) 2025-01-22 17:15:45 -05:00
frontend_manager_test.py Move parsing of requirements logic to function. (#12701) 2026-02-28 22:21:32 -05:00
model_manager_test.py Support preview images embedded in safetensors metadata (#6119) 2024-12-19 14:01:56 -08:00
node_replace_manager_test.py fix: make NodeReplaceManager.register() idempotent 2026-04-28 03:03:41 -07:00
test_migrations.py feat(assets): align local API with cloud spec (#12863) 2026-03-16 12:34:04 -07:00
user_manager_system_user_test.py feat(security): add System User protection with __ prefix (#10966) 2025-11-28 21:28:42 -05:00