Repository navigation
fix(litegraph): avoid delete on widgetId in SubgraphNode - #16717
Conversation
Replace the delete operator with input.widgetId = undefined at all three sites (unlink cleanup, unassigned-node guard, failed-registration guard). widgetId is already an optional field (src/lib/litegraph/src/interfaces.ts:375), so assignment is a semantically equivalent, proxy-safe replacement. delete has been flagged as a source of issues with the compatibility proxies used elsewhere in this file. Forward fix per review thread on FE #16679 (cloud/1.53 backport): #16679 (comment) No callers check key presence (in/hasOwnProperty) or serialize input directly, so this is a pure behavior-preserving substitution.
🎭 Playwright: ✅ 1913 passed, 0 failed📊 Browser Reports
🎨 Storybook: ✅ Built — View Storybook📦 Bundle: 9.68 MB gzip 🔴 +63 BDetailsSummary
Category Glance App Entry Points — 3.74 kB (baseline 3.74 kB) • ⚪ 0 BMain entry bundles and manifests
Status: 1 added / 1 removed Graph Workspace — 1.42 MB (baseline 1.42 MB) • ⚪ 0 BGraph editor runtime, canvas, workflow orchestration
Status: 2 added / 2 removed / 1 unchanged Views & Navigation — 124 kB (baseline 124 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Status: 13 added / 13 removed / 4 unchanged Panels & Settings — 621 kB (baseline 621 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
Status: 10 added / 10 removed / 17 unchanged User & Accounts — 27.8 kB (baseline 27.8 kB) • ⚪ 0 BAuthentication, profile, and account management bundles
Status: 6 added / 6 removed / 5 unchanged Editors & Dialogs — 126 kB (baseline 126 kB) • ⚪ 0 BModals, dialogs, drawers, and in-app editors
Status: 7 added / 7 removed / 1 unchanged UI Components — 117 kB (baseline 117 kB) • ⚪ 0 BReusable component library chunks
Status: 7 added / 7 removed / 8 unchanged Data & Services — 3.59 MB (baseline 3.59 MB) • 🔴 +6 BStores, services, APIs, and repositories
Status: 13 added / 13 removed / 3 unchanged Utilities & Hooks — 560 kB (baseline 560 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Status: 18 added / 18 removed / 18 unchanged Vendor & Third-Party — 18.1 MB (baseline 18.1 MB) • ⚪ 0 BExternal libraries and shared vendor chunks Status: 18 unchanged Other — 16.4 MB (baseline 16.4 MB) • ⚪ 0 BBundles that do not match a named category
Status: 72 added / 72 removed / 223 unchanged ⚡ Performance
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe change updates three widget binding cleanup paths in ChangesWidget binding cleanup
Estimated code review effort: 1 (Trivial) | ~2 minutes Merge Risk: ⚪ Minimal · up to This narrowly scoped change replaces proxy-sensitive property deletion with clearing an optional field, with no actionable merge-blocking risk remaining after normal checks and review. Suggested reviewers: Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 inconclusive)
✅ Passed checks (6 passed)
Full details: Description checkExplanation The description explains what changed, why it changed, affected call sites, compatibility concerns, and verification results. It does not use the template's Full details: End-To-End Regression Coverage For FixesExplanation The PR metadata provides the changed file and description, but it does not provide the PR title or commit subjects. The check requires those fields to evaluate the bug-fix language condition. I cannot determine whether the failure conditions are satisfied without guessing. Resolution Provide the PR title and commit subjects, then reassess whether the bug-fix signal is present. If it is present, verify whether the PR changes a Playwright test under Full details: Adr Compliance For Entity/Litegraph ChangesExplanation PASS. The PR changes only
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
| delete input.pos | ||
| delete input.widget |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #16717 +/- ##
==========================================
+ Coverage 80.89% 82.47% +1.57%
==========================================
Files 2450 2032 -418
Lines 125008 117536 -7472
Branches 33362 31537 -1825
==========================================
- Hits 101121 96932 -4189
+ Misses 23374 20426 -2948
+ Partials 513 178 -335
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 424 files with indirect coverage changes 🚀 New features to boost your workflow:
|
|
Follow-up merged: #16742 landed the remaining proxy-safe cleanup in Full context for agent readersThe follow-up replaces |
…#16742) ## Summary Replaces `delete input.pos` and `delete input.widget` with `input.pos = undefined` / `input.widget = undefined` at the two remaining call sites in `SubgraphNode.ts` (unlink cleanup, failed-registration guard). ## Why Follow-up from a review thread on [Comfy-Org#16717](Comfy-Org#16717 (comment)): > Want to do all 3? — @DrJKL Comfy-Org#16717 replaced `delete input.widgetId` with `input.widgetId = undefined` at three call sites, since `delete` has been a source of issues with the compatibility proxies. DrJKL's comment, on the third call site (which also deletes `pos` and `widget` right next to `widgetId`), asked to apply the same treatment to all 3 fields, not just `widgetId`. This PR completes that at both remaining sites that still had `delete input.pos` / `delete input.widget`. Both fields are optional on `INodeInputSlot` (`pos?: Point`, `widget?: IWidgetLocator`, `src/lib/litegraph/src/interfaces.ts`), so assignment is a semantically equivalent, proxy-safe replacement for `delete`. ## Evidence - `NODE_OPTIONS="--no-experimental-webstorage" npx vitest run src/lib/litegraph/src/subgraph/`: 18 files, 323/323 passed. - `npx vue-tsc --noEmit` (full project): clean. - `npx eslint src/lib/litegraph/src/subgraph/SubgraphNode.ts`: 0 errors, 2 pre-existing unrelated warnings (restricted-path imports, present before this change). <!-- authored-by:agent lane-act-fe-16717-followup-2e392d0d -->
|
@christian-byrne Successfully backported to #16750 |
|
@christian-byrne Successfully backported to #16751 |
|
|
…58) (Comfy-Org#17486) *PR Created by the Glary-Bot Agent* --- Fixes the `scale_multiplier` widget on the `utility_seedvr2_3b_int8_upscale_image` template rendering as a disconnected input slot, with a duplicate `resize_type.multiplier_1` appended below it. Reproduces on current `main`; neither Comfy-Org#16717 nor its backport Comfy-Org#16751 touched the failing path. - Fixes FE-258 ## Root cause A node is constructed with its dynamic combo's **default** option laid out (`resize_type.width/height/crop`), and `ComfyNode.configure` rewrites `data.inputs` into that definition order, appending the serialized inputs the definition lacks. Serialized `target_slot` values count the **saved** layout, so link `50` — saved on `resize_type.multiplier` at slot 1 — lands on slot 1 of the rebuilt layout, which is a different input. Applying the combo's serialized value then tears the group down and hands each surviving link to the new input of the same name. The link is sitting on `resize_type.width`, which the selected option does not define, so it is dropped. Across a subgraph boundary the promoted input is demoted to a bare slot and a duplicate `_1` promotion is auto-created. ## Fix Realign the node's input links by name in `LGraphNode.configure`, after slots are wired and before widget values are applied — the window in which the correct slot exists. Scoped to nodes that have a group widget child input; `LGraph.configure`'s existing pass still runs for everything else once all nodes are configured. The node's ordinary inputs join the batch so a link still occupying a child's destination slot moves in the same atomic update instead of blocking it. Inputs owned by a group that is not a widget (autogrow) stay out because their slots grow and renumber during configure. ## Verification - `pnpm test:unit src/lib/litegraph/src/LGraph.inputSlotRealign.test.ts`: 21 passed. - `pnpm test:browser:local browser_tests/tests/subgraph/subgraphPromotedDynamicComboChild.spec.ts`: 2 passed after the development server warmed up. The first cold-start run timed out before the app became ready; its second test passed. - `pnpm typecheck`, `pnpm typecheck:browser`, `pnpm lint`, `pnpm format:check`, and `pnpm knip` passed. ## Unverified residuals - An excluded autogrow link can block the early batch and produce a `Failed to realign input link slots` log. This PR does not include a complete-config base/head test for the final topology in that case. - A nested dynamic combo under a non-default outer option is excluded because its widget does not exist at this point in configure. Base/head parity for that case was not reverified in this review round. ## Screenshots   --------- Co-authored-by: Glary-Bot <glary-bot@users.noreply.github.com> Co-authored-by: Amp <amp@ampcode.com>
…58) (#17486) *PR Created by the Glary-Bot Agent* --- Fixes the `scale_multiplier` widget on the `utility_seedvr2_3b_int8_upscale_image` template rendering as a disconnected input slot, with a duplicate `resize_type.multiplier_1` appended below it. Reproduces on current `main`; neither #16717 nor its backport #16751 touched the failing path. - Fixes FE-258 ## Root cause A node is constructed with its dynamic combo's **default** option laid out (`resize_type.width/height/crop`), and `ComfyNode.configure` rewrites `data.inputs` into that definition order, appending the serialized inputs the definition lacks. Serialized `target_slot` values count the **saved** layout, so link `50` — saved on `resize_type.multiplier` at slot 1 — lands on slot 1 of the rebuilt layout, which is a different input. Applying the combo's serialized value then tears the group down and hands each surviving link to the new input of the same name. The link is sitting on `resize_type.width`, which the selected option does not define, so it is dropped. Across a subgraph boundary the promoted input is demoted to a bare slot and a duplicate `_1` promotion is auto-created. ## Fix Realign the node's input links by name in `LGraphNode.configure`, after slots are wired and before widget values are applied — the window in which the correct slot exists. Scoped to nodes that have a group widget child input; `LGraph.configure`'s existing pass still runs for everything else once all nodes are configured. The node's ordinary inputs join the batch so a link still occupying a child's destination slot moves in the same atomic update instead of blocking it. Inputs owned by a group that is not a widget (autogrow) stay out because their slots grow and renumber during configure. ## Verification - `pnpm test:unit src/lib/litegraph/src/LGraph.inputSlotRealign.test.ts`: 21 passed. - `pnpm test:browser:local browser_tests/tests/subgraph/subgraphPromotedDynamicComboChild.spec.ts`: 2 passed after the development server warmed up. The first cold-start run timed out before the app became ready; its second test passed. - `pnpm typecheck`, `pnpm typecheck:browser`, `pnpm lint`, `pnpm format:check`, and `pnpm knip` passed. ## Unverified residuals - An excluded autogrow link can block the early batch and produce a `Failed to realign input link slots` log. This PR does not include a complete-config base/head test for the final topology in that case. - A nested dynamic combo under a non-default outer option is excluded because its widget does not exist at this point in configure. Base/head parity for that case was not reverified in this review round. ## Screenshots   --------- Co-authored-by: Glary-Bot <glary-bot@users.noreply.github.com> (cherry picked from commit 3f29ced) (cherry picked from commit 3ebfb0c)
Summary
Replaces
delete input.widgetIdwithinput.widgetId = undefinedat the three call sites inSubgraphNode.ts(unlink cleanup, unassigned-node guard, failed-registration guard).widgetIdis an optional field (widgetId?: WidgetId,src/lib/litegraph/src/interfaces.ts:375), so assignment is a semantically equivalent, proxy-safe replacement fordelete.Why
Follow-up from a review thread on the cloud/1.53 backport #16679:
That backport kept the pattern byte-identical to
main(it predates the change under review, also present at the merged core twin #16678). This PR is the forward fix onmain; bothcloud/1.53andcore/1.53can backport it once merged.Verification
in/hasOwnProperty) or serializesinputdirectly — pure behavior-preserving substitution.SubgraphNode.test.ts+SubgraphNode.titleButton.test.ts: 61/61 passed.src/lib/litegraph/src/subgraph/suite: 323/323 passed.eslinton the changed file: 0 errors (2 pre-existing, unrelated warnings).vue-tsc --noEmit: clean.