Commit 53d6e5b
committed
feat(v7-i03): synchronous trainInFlight lock closes H22 race window
Closes V7-I03 (cppmega-mlx-pi1a): H22 disabled the Train button via
the trainInFlight React state, but React commits state updates
asynchronously so a 0ms-delay double click could pass the
prop-disabled check on both invocations and fire pipeline.run
twice.
Fix: trainInFlightLockRef (useRef<boolean>) mutated SYNCHRONOUSLY
at the top of handleRunPipeline before any await. The second
microtask click reads the ref already true and returns early.
Released in the finally block so legitimate sequential trains
work normally.
Tests:
- vbgui e2e 79_concurrent_train_race.spec.ts: zero-delay double
click via page.evaluate(() => { btn.click(); btn.click(); })
→ asserts exactly 1 pipeline.run HTTP POST. 1/1 passing.
- vbgui e2e concurrency regression (H03 + H22 + V7-I03): 3/3
passing — no regression in cancel or button-disabled flows.1 parent 57ba5b9 commit 53d6e5b
2 files changed
Lines changed: 58 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
110 | 116 | | |
111 | 117 | | |
112 | 118 | | |
| |||
371 | 377 | | |
372 | 378 | | |
373 | 379 | | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
374 | 388 | | |
375 | 389 | | |
| 390 | + | |
376 | 391 | | |
377 | 392 | | |
378 | 393 | | |
| |||
471 | 486 | | |
472 | 487 | | |
473 | 488 | | |
| 489 | + | |
474 | 490 | | |
475 | 491 | | |
476 | 492 | | |
| |||
0 commit comments