fix(FN-5363): implement targetTaskId in store SQL so lease targets correct task
The previous commit wired targetTaskId through the engine caller but the store's acquireMergeQueueLease SQL still grabbed the queue head unconditionally, leaving the no-lease loop intact. This lands the store-side change: when targetTaskId is provided it attempts a direct-match UPDATE first; only falls back to queue-head ordering if that row isn't available (backward-compatible). Adds regression test covering the polluted-queue-head scenario (FN-5363). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
5
.changeset/fix-merge-queue-pollution-no-lease.md
Normal file
5
.changeset/fix-merge-queue-pollution-no-lease.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@runfusion/fusion": patch
|
||||
---
|
||||
|
||||
Fix merge queue lease race causing all in-review tasks to fail with merge:reuse-handoff-refused (no-lease) when unrelated tasks pollute the queue head. acquireReuseHandoff now targets the specific task ID rather than blindly grabbing the queue head, so the correct task gets the lease regardless of stale queue entries.
|
||||
Reference in New Issue
Block a user