Comfy-Org / Comfy-Org/ComfyUI_frontend
test: the link-cull slot.pos exclusion is unguarded (reverting it leaves 1027/1027 passing)
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 699
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 490
Description
## Summary
The link-culling fast path added in #15030 correctly excludes links whose endpoints use a hard-coded `INodeSlot.pos`, but that exclusion has no test that fails when it is removed. Reverting it leaves **1027 of 1027** litegraph tests passing.
## Why it matters
`calculateInputSlotPosFromSlot` returns `[nodeX + pos[0], nodeY + pos[1]]` with no clamp to the node rect, so an extension can place a connection point anywhere, including well outside the node's bounds. The cull decides visibility from the endpoint nodes' bounds, so without the exclusion those links are culled while still visibly on screen: the link disappears with no indication why, and only for workflows using extensions that set `slot.pos`.
That is a visible bug class affecting third-party extensions specifically, which is the population least able to diagnose it.
## Why the current test cannot catch it
The test shipped with the exclusion exercises `couldLinkBeVisible` in isolation and never calls `drawConnections`. The exclusion lives on the `drawConnections` path, so a unit test at that level cannot fail for this defect.
## What would close it
An integration-level test that drives `drawConnections` with a node whose slot carries a hard-coded `pos` placing the connection point outside the node rect, asserting the link is still rendered when that point is on screen. Mutating the exclusion out should make it fail.
## Affected area
- `src/lib/litegraph/src/LGraphCanvas.ts` (the `drawConnections` cull site)
- `src/lib/litegraph/src/measure.ts` (`couldLinkBeVisible`)
- `src/lib/litegraph/src/linkCulling.test.ts`
Found by mutation testing during review of #15030. Verified surviving at `76cca1d086`.
Contributor guide
Assessment
This issue has not been assessed yet.