src/core/fleet_ops.ts makes two undos of one fleet operation race safely: claimUndo takes the operation once, releaseUndo gives it back when the undo came to nothing. test/fleet-ops.test.ts exercises undo end to end but never the claim itself.
Done when a test (new file or a new block in test/fleet-ops.test.ts) proves on a recorded operation:
[ ] the first claimUndo is true and a second is false.
[ ] after releaseUndo, claimUndo is true again.
[ ] once an undo has finished (its undone_by set to a real operation id), releaseUndo leaves it as it is and claimUndo stays false.
[ ] claimUndo on an unknown id is false.
Test only; a bug it finds is fixed in the same pull.
src/core/fleet_ops.tsmakes two undos of one fleet operation race safely:claimUndotakes the operation once,releaseUndogives it back when the undo came to nothing.test/fleet-ops.test.tsexercises undo end to end but never the claim itself.Done when a test (new file or a new block in
test/fleet-ops.test.ts) proves on a recorded operation:claimUndois true and a second is false.releaseUndo,claimUndois true again.undone_byset to a real operation id),releaseUndoleaves it as it is andclaimUndostays false.claimUndoon an unknown id is false.Test only; a bug it finds is fixed in the same pull.