Skip to content

fix(builder): prevent rapid edge deletes from resurrecting connections - #44

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-management-478d
Draft

cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-management-478d

Conversation

@cursor

@cursor cursor Bot commented Aug 3, 2026

Copy link
Copy Markdown

Summary

Fixes workflow connection data loss when users delete multiple edges before React re-renders.

Bug and impact

handleEdgesChange computed PATCH payloads from a stale edges closure, so a second delete could PATCH an older connection set and resurrect edges on the server.

Root cause

Sequential edge deletes read React Flow edges captured before state updates flushed.

Fix and validation

  • Track optimistic workflow.connections in a ref updated synchronously on each delete.
  • Added removeConnectionsById helper with unit tests.
  • npm run test:run -- tests/lib/workflow-to-reactflow.test.ts
Open in Web View Automation 

Track optimistic connection state across sequential deletes instead of
reading stale React Flow edges from the callback closure.

Co-authored-by: esadrianno <esadrianno@gmail.com>
@vercel

vercel Bot commented Aug 3, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
v0-agent-kit Ready Ready Preview, v0 Aug 3, 2026 11:11am

This branch was successfully deployed

1 active deployment
Preview — f381ebda Deployed Aug 3, 2026 by vercel[bot]
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