Comfy-Org / Comfy-Org/ComfyUI_frontend

settings: LiteGraph.Canvas.MinFontSizeForLOD is unreachable in Vue-nodes mode

Open
#15,286 1 comment 1 reaction 1 assignee Claimed by @benjcooley View on GitHub
area:settings area:vue-migration
Dominant language
TypeScript
Stars
2k
Forks
699
Avg merge
1d 7h
Merged PRs (30d)
490

Description

### FU2 — Two more unmount-path lifetime bugs that culling makes routine, both mirroring the fix #15030 just made

> #15030 added an owner-scoped teardown guard to `useNodePointerInteractions`
> (`onScopeDispose(() => { if (hasDraggingStarted) cleanupDragState() })`). Two sibling composables
> have the same hazard and no such guard, and culling is what makes unmount-mid-interaction routine.
> (a) `useNodeResize.ts:241-243` registers `pointermove`/`pointerup`/`pointercancel` via
> `useEventListener` inside `startResize`, an event handler, so no effect scope is active and
> VueUse's `tryOnScopeDispose` is a no-op. Teardown depends entirely on `cleanup()` firing from
> `pointerup`/`pointercancel`, so if the node unmounts mid-resize the listeners and the global
> `layoutStore.isResizingVueNodes = true` flag outlive the component until the next pointer-up. The
> fix is one line: `onScopeDispose(() => { if (isResizing.value) cleanup() })` at composable setup,
> mirroring the sibling. (b) `useVueNodeResizeTracking.ts:291-315` observes an element captured at
> mount (`getCurrentInstance()?.proxy?.$el`) but re-reads `$el` at unmount time to unobserve it.
> `LGraphNode.vue`'s root is `v-if="renderError"` / `v-else`, so the root element identity can change
> while mounted; if `onErrorCaptured` fires, the originally-observed element is never unobserved and
> the module-level shared `ResizeObserver` retains a detached subtree permanently along with its
> `deferredElements` and `cachedNodeMeasurements` entries. Capture the element in a local at mount
> and unobserve that reference. Per-error rather than per-pan, but culling gives error-boundary
> swaps far more chances to fire.

---
Found during round 3 review of #15031. Filed as a follow-up so it is not lost when that PR merges.

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.