Comfy-Org / Comfy-Org/ComfyUI_frontend

test: add double-nesting test for disambiguatingSourceNodeId preservation in _repointAncestorPromotions

Open
#10,555 0 comments 0 reactions 1 assignee Claimed by @christian-byrne View on GitHub
area:subgraph area:testing
Dominant language
TypeScript
Stars
2k
Forks
699
Avg merge
1d 7h
Merged PRs (30d)
490

Description

## Summary

Add a test to `src/lib/litegraph/src/LGraph.repointAncestorPromotions.test.ts` that performs **two levels of nested subgraph packing** and verifies that the second pack operation preserves the original `disambiguatingSourceNodeId` from the first pack, rather than overwriting it.

## Context

Currently, the `_repointAncestorPromotions` test suite does not cover the `entry.disambiguatingSourceNodeId ?? entry.sourceNodeId` fallback path when `disambiguatingSourceNodeId` is already set (i.e., after a double nesting). If packing is done twice, the second operation should preserve the original disambiguating ID from the first pack.

This gap was identified during review of PR #10532 (fix: repoint ancestor promoted widget bindings when packing nested subgraphs).

## Acceptance Criteria

- Add a new `it` block (e.g., `'preserves disambiguatingSourceNodeId through multiple levels of nesting'`) to the existing describe suite in `src/lib/litegraph/src/LGraph.repointAncestorPromotions.test.ts`.
- The test should:
1. Promote an interior node widget on a host SubgraphNode.
2. Pack the interior node into a nested subgraph (first pack) — assert `disambiguatingSourceNodeId` is set to the original interior node ID.
3. Pack the resulting nested subgraph node into a second nested subgraph (second pack) — assert `disambiguatingSourceNodeId` is still the original interior node ID, not overwritten by the intermediate nested node ID.

## References

- PR: https://github.com/Comfy-Org/ComfyUI_frontend/pull/10532
- Review comment: https://github.com/Comfy-Org/ComfyUI_frontend/pull/10532#discussion_r2992018034
- Requested by: @christian-byrne

┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-10555-test-add-double-nesting-test-for-disambiguatingSourceNodeId-preservation-in-_repoint-32f6d73d365081c3932edd513a5d0adf) by [Unito](https://www.unito.io)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.