fix: Vue mode socket map data not cleaned up on dynamic input changes#8469
fix: Vue mode socket map data not cleaned up on dynamic input changes#8469christian-byrne merged 2 commits intomainfrom
Conversation
Fixes authentication failure when using API key authentication on staging. The previous code used getFirebaseAuthHeader() which only returns Firebase tokens. API key users got null and failed with 'no Comfy user associated'. getAuthHeader() correctly falls back to X-API-KEY header when no Firebase token is available, and the backend /customers endpoint supports this. Fixes COM-12398 Amp-Thread-ID: https://ampcode.com/threads/T-019c07f6-f594-76a8-91c7-cb1a8cd1cb5d Co-authored-by: Amp <amp@ampcode.com>
…put changes When DynamicCombo widgets add/remove inputs, Vue was reusing slot components instead of properly unmounting them because the v-for key was based on array index. This caused socket map data to leak and become desynced. Changes: - Use input.name/output.name as Vue :key instead of array index - Add defensive cleanup in useSlotElementTracking to handle edge cases Fixes COM-12970 Amp-Thread-ID: https://ampcode.com/threads/T-019c089a-0492-71ff-8ce0-73e08f4f434b Co-authored-by: Amp <amp@ampcode.com>
|
Important Review skippedAuto reviews are limited based on label configuration. 🚫 Review skipped — only excluded labels are configured. (1)
Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🎨 Storybook Build Status✅ Build completed successfully! ⏰ Completed at: 01/30/2026, 03:00:20 AM UTC 🔗 Links🎉 Your Storybook is ready for review! |
🎭 Playwright Tests:
|
Bundle Size ReportSummary
Category Glance Per-category breakdownApp Entry Points — 26 kB (baseline 26 kB) • ⚪ 0 BMain entry bundles and manifests
Status: 1 added / 1 removed Graph Workspace — 974 kB (baseline 974 kB) • ⚪ 0 BGraph editor runtime, canvas, workflow orchestration
Status: 1 added / 1 removed Views & Navigation — 80.7 kB (baseline 80.7 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Status: 9 added / 9 removed Panels & Settings — 471 kB (baseline 471 kB) • 🟢 -8 BConfiguration panels, inspectors, and settings screens
Status: 12 added / 12 removed User & Accounts — 3.94 kB (baseline 3.94 kB) • ⚪ 0 BAuthentication, profile, and account management bundles
Status: 3 added / 3 removed Editors & Dialogs — 2.89 kB (baseline 2.89 kB) • ⚪ 0 BModals, dialogs, drawers, and in-app editors
Status: 2 added / 2 removed UI Components — 33.7 kB (baseline 33.7 kB) • ⚪ 0 BReusable component library chunks
Status: 4 added / 4 removed Data & Services — 2.71 MB (baseline 2.71 MB) • 🔴 +206 BStores, services, APIs, and repositories
Status: 8 added / 8 removed Utilities & Hooks — 25.3 kB (baseline 25.3 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Status: 7 added / 7 removed Vendor & Third-Party — 10.7 MB (baseline 10.7 MB) • ⚪ 0 BExternal libraries and shared vendor chunks
Other — 7.1 MB (baseline 7.1 MB) • 🟢 -198 BBundles that do not match a named category
Status: 34 added / 34 removed |
AustinMroz
left a comment
There was a problem hiding this comment.
I think the auth changes is leaking from a different PR?
I was aware that this was a problem, but expected fixing it to be really involved. Happy to see a simple fix for it.
…#8469) ## Summary Fixes a bug where socket map data was not properly removed when sockets are dynamically added/removed via DynamicCombo widgets in Vue mode (Nodes 2.0). ## Problem When DynamicCombo widgets (e.g., `should_remesh` on Meshy nodes) change their selection, inputs are dynamically added/removed. The Vue `v-for` loop in `NodeSlots.vue` was using array index as the `:key`, causing Vue to **reuse** slot components instead of properly unmounting them. This led to: - Socket map entries leaking (never cleaned up) - Socket positions becoming desynced - Stale cached offset data ## Solution 1. **Use slot `name` as Vue key** instead of array index in `NodeSlots.vue` - Slot names are unique per node (enforced by ComfyUI backend) - When a slot is removed, Vue sees the key disappear and properly unmounts the component - `onUnmounted` cleanup in `useSlotElementTracking` now runs correctly 2. **Add defensive cleanup** in `useSlotElementTracking.ts` - Before registering a new slot, check if a stale entry exists with the same key - Clean up stale entry to handle any edge cases ## Related - Fixes COM-12970 - Related to #7837 (fixed LiteGraph version of this bug, but not Vue mode) ## Testing - Quality checks pass (typecheck, lint, format) - Manual testing with DynamicCombo nodes (Meshy, nodes_logic) recommended ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8469-fix-Vue-mode-socket-map-data-not-cleaned-up-on-dynamic-input-changes-2f86d73d365081e599eadca4f15e6b6e) by [Unito](https://www.unito.io) --------- Co-authored-by: Subagent 5 <subagent@example.com> Co-authored-by: Amp <amp@ampcode.com>
…#8469) ## Summary Fixes a bug where socket map data was not properly removed when sockets are dynamically added/removed via DynamicCombo widgets in Vue mode (Nodes 2.0). ## Problem When DynamicCombo widgets (e.g., `should_remesh` on Meshy nodes) change their selection, inputs are dynamically added/removed. The Vue `v-for` loop in `NodeSlots.vue` was using array index as the `:key`, causing Vue to **reuse** slot components instead of properly unmounting them. This led to: - Socket map entries leaking (never cleaned up) - Socket positions becoming desynced - Stale cached offset data ## Solution 1. **Use slot `name` as Vue key** instead of array index in `NodeSlots.vue` - Slot names are unique per node (enforced by ComfyUI backend) - When a slot is removed, Vue sees the key disappear and properly unmounts the component - `onUnmounted` cleanup in `useSlotElementTracking` now runs correctly 2. **Add defensive cleanup** in `useSlotElementTracking.ts` - Before registering a new slot, check if a stale entry exists with the same key - Clean up stale entry to handle any edge cases ## Related - Fixes COM-12970 - Related to #7837 (fixed LiteGraph version of this bug, but not Vue mode) ## Testing - Quality checks pass (typecheck, lint, format) - Manual testing with DynamicCombo nodes (Meshy, nodes_logic) recommended ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8469-fix-Vue-mode-socket-map-data-not-cleaned-up-on-dynamic-input-changes-2f86d73d365081e599eadca4f15e6b6e) by [Unito](https://www.unito.io) --------- Co-authored-by: Subagent 5 <subagent@example.com> Co-authored-by: Amp <amp@ampcode.com>
Summary
Fixes a bug where socket map data was not properly removed when sockets are dynamically added/removed via DynamicCombo widgets in Vue mode (Nodes 2.0).
Problem
When DynamicCombo widgets (e.g.,
should_remeshon Meshy nodes) change their selection, inputs are dynamically added/removed. The Vuev-forloop inNodeSlots.vuewas using array index as the:key, causing Vue to reuse slot components instead of properly unmounting them.This led to:
Solution
Use slot
nameas Vue key instead of array index inNodeSlots.vueonUnmountedcleanup inuseSlotElementTrackingnow runs correctlyAdd defensive cleanup in
useSlotElementTracking.tsRelated
Testing
┆Issue is synchronized with this Notion page by Unito