Skip to content

fix(builder): batch multi-select node deletes atomically - #41

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

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

Conversation

@cursor

@cursor cursor Bot commented Jul 29, 2026

Copy link
Copy Markdown

Bug and impact

Multi-select delete in the workflow builder fired parallel DELETE /nodes/:id requests. Each handler does read-modify-write on the workflow graph, so concurrent deletes raced and the last write won — leaving some selected nodes behind after the user deleted multiple nodes at once (silent partial data loss).

Root cause

handleNodeDelete used Promise.all over per-node DELETE routes introduced in PR #39 review feedback (da21695). deleteWorkflowNode always reads the full workflow, filters one node, and writes back, so parallel calls overwrite each other.

Fix

  • Add deleteWorkflowNodes for a single atomic read-filter-write.
  • Add DELETE /api/workflows/:id/nodes with { nodeIds: string[] } for multi-delete.
  • Route multi-select deletes through the batch endpoint; keep single-node DELETE for one id.

Validation

  • pnpm test:run tests/api/workflows.test.ts (18 tests, including new batch delete coverage).
Open in Web View Automation 

Parallel per-node DELETE requests raced read-modify-write cycles and
left some selected nodes behind. Route multi-delete through a single
deleteWorkflowNodes update and add API coverage.

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

vercel Bot commented Jul 29, 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, Comment, Open in v0 Jul 29, 2026 11:06am

This branch was successfully deployed

1 active deployment
Preview — 34beefbe Deployed Jul 29, 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