mirror of
https://github.com/wekan/wekan.git
synced 2026-11-24 20:45:00 -05:00
Two undos that picked the same History row - two tabs, or a repeating
key - both applied it, both flipped its flag unconditionally afterwards
and both recorded a reversal, so History gained duplicate reversal rows.
Undo and redo now claim an ordinary row first with a conditional flag
write (a live row for undo, an undone and not superseded row for redo);
only the caller whose claim matched applies it, and the others are told
they lost the race. An apply that does nothing or throws gives the claim
back exactly as taken, so a row is still never left marked undone when
nothing was undone. Scrum rows keep their own conditional finalizer.
A new full-app test fires four concurrent undos and four redos at a real
card edit: one wins each time, the title changes once and one reversal
is recorded per direction; it fails against the previous code ("exactly
one undo wins"). It also pins that a claim is released after an apply
that does nothing and after one that throws. Source guards follow.
Thanks to xet7 !