Skip to content

Conversation

@yasir-ali9
Copy link

Description

Fixes an issue where users could create multiple edges between the same two nodes, causing duplicate connections in the workflow data.

Problem

Users could drag from a node handle multiple times to create duplicate edges between the same source and target nodes. This created redundant data and visual clutter in the workflow canvas.

Example of the issue:

"edges": [
  {"id": "edge1", "source": "nodeA", "target": "nodeB"},
  {"id": "edge2", "source": "nodeA", "target": "nodeB"},  // Duplicate
  {"id": "edge3", "source": "nodeA", "target": "nodeB"}   // Duplicate
]

Solution

Added duplicate edge prevention in the onConnect and handleConnectionToNewNode functions in workflow-canvas.tsx:

Check for existing edges between the same source and target before creating new ones
Early return if a duplicate edge already exists
Maintains existing UX while preventing data integrity issues

@vercel
Copy link
Contributor

vercel bot commented Dec 12, 2025

@yasir-ali9 is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant