-
Notifications
You must be signed in to change notification settings - Fork 390
Prevent partial copy of custom widgets when performing linked promotion on subgraphs #6079
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,7 +26,7 @@ import type { | |
| } from '@/lib/litegraph/src/types/serialisation' | ||
| import type { IBaseWidget } from '@/lib/litegraph/src/types/widgets' | ||
| import type { UUID } from '@/lib/litegraph/src/utils/uuid' | ||
| import { toConcreteWidget } from '@/lib/litegraph/src/widgets/widgetMap' | ||
| import { BaseWidget } from '@/lib/litegraph/src/widgets/BaseWidget' | ||
|
|
||
| import { ExecutableNodeDTO } from './ExecutableNodeDTO' | ||
| import type { ExecutableLGraphNode, ExecutionId } from './ExecutableNodeDTO' | ||
|
|
@@ -317,9 +317,10 @@ export class SubgraphNode extends LGraphNode implements BaseLGraph { | |
| inputWidget: IWidgetLocator | undefined | ||
| ) { | ||
| // Use the first matching widget | ||
| const promotedWidget = toConcreteWidget(widget, this).createCopyForNode( | ||
| this | ||
| ) | ||
| const promotedWidget = | ||
AustinMroz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| widget instanceof BaseWidget | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [architecture] high Priority Issue: Type safety concern - no runtime type checking for BaseWidget instanceof check |
||
| ? widget.createCopyForNode(this) | ||
| : { ...widget, node: this } | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [quality] medium Priority Issue: Inconsistent widget copying strategies may lead to different behavior There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [security] low Priority Issue: Object spread may inadvertently copy unsafe properties from untrusted widgets |
||
|
|
||
| Object.assign(promotedWidget, { | ||
| get name() { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.