Skip to content

fix(builder): batch multi-select drag position saves atomically - #46

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

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

Conversation

@cursor

@cursor cursor Bot commented Aug 6, 2026

Copy link
Copy Markdown

Bug and impact

Multi-select drag on the workflow canvas silently lost one node's persisted position after reload. Users could drag two or more selected nodes together, but only one node's new coordinates were saved.

Root cause

handleNodeDragStop fired once per dragged node and issued separate PATCH /nodes/:id requests. The server updates nodes via read-modify-write on the full nodes array (getWorkflow → map one node → updateWorkflow). Concurrent PATCHes read the same pre-drag snapshot; whichever completed last overwrote the other node's old position.

Fix

Coalesce drag-stop position updates into a single PATCH /api/workflows/:id with the full updated nodes array per microtask batch. Added a unit test that simulates two synchronous drag-stop events and asserts one atomic workflow PATCH.

Validation

  • pnpm run test:run tests/components/use-builder-graph-mutations.test.tsx
Open in Web View Automation 

Concurrent per-node PATCH requests during multi-select drag used
read-modify-write on the full nodes array, so the last write could
revert another node's new position. Coalesce drag-stop updates into
one workflow PATCH per microtask batch.

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

vercel Bot commented Aug 6, 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 6, 2026 11:13am

This branch was successfully deployed

1 active deployment
Preview — 602141b5 Deployed Aug 6, 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