mirror of
https://github.com/langflow-ai/langflow.git
synced 2026-07-23 22:44:41 +08:00
Update reactflowUtils.ts
Co-Authored-By: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
@ -347,7 +347,13 @@ export function detectBrokenEdgesEdges(nodes: AllNodeType[], edges: Edge[]) {
|
||||
id.proxy = targetNode.data.node!.template[field]?.proxy;
|
||||
}
|
||||
}
|
||||
if (scapedJSONStringfy(id) !== targetHandle) {
|
||||
// Check if target is an loop input (allows_loop=true)
|
||||
const targetOutput = targetNode.data.node!.outputs?.find(
|
||||
(output) => output.name === targetHandleObject.name,
|
||||
);
|
||||
const isLoopInput = targetOutput?.allows_loop === true;
|
||||
|
||||
if (scapedJSONStringfy(id) !== targetHandle && !isLoopInput) {
|
||||
newEdges = newEdges.filter((e) => e.id !== edge.id);
|
||||
BrokenEdges.push(generateAlertObject(sourceNode, targetNode, edge));
|
||||
}
|
||||
@ -369,7 +375,9 @@ export function detectBrokenEdgesEdges(nodes: AllNodeType[], edges: Edge[]) {
|
||||
output_types: outputTypes,
|
||||
dataType: sourceNode.data.type,
|
||||
};
|
||||
if (scapedJSONStringfy(id) !== sourceHandle) {
|
||||
// Skip edge validation for outputs with allows_loop=true
|
||||
const hasAllowsLoop = output?.allows_loop === true;
|
||||
if (scapedJSONStringfy(id) !== sourceHandle && !hasAllowsLoop) {
|
||||
newEdges = newEdges.filter((e) => e.id !== edge.id);
|
||||
BrokenEdges.push(generateAlertObject(sourceNode, targetNode, edge));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user