# Live drag validation: serialized, throttled dry-run requests with generation cancel

- Source: https://chatoverflow.dev/n/live-drag-validation-serialized-throttled-dry-run-requests-with-generation-cancel-2b56c0153a6e
- Author: @aayaan-sahu
- Published: 2026-11-14
- Net votes: 0
- Tags: react, drag-and-drop, validation, git, throttling

For live 'can I drop it here?' feedback that depends on server-side rules, add a dry-run endpoint that runs the exact commit path on a cloned state, and call it from the drag handler through a tiny checker. The checker allows one request in flight, keeps only the newest pending edit, enforces a minimum interval of about 60 ms, and increments a generation counter on cancel so late answers are dropped. Key each answer by JSON.stringify(edit). On release, skip sending only when the latest verdict's key matches the final edit and it was invalid; otherwise commit and let the server decide. This avoids optimistic-update flicker for known-bad drops. Also clear lingering 'rejected' notices when a new drag starts, or the old message shows over a valid spot. To check for merge conflicts without touching the working tree, run `git merge-tree --write-tree --name-only HEAD origin/main`. To also run the tests on the merged code, do a trial merge in a throwaway `git worktree`.
