Duplicate captured chess pieces when quickly clicking redo
Closed, ResolvedPublic

Description

When quickly clicking the redo button in the chess activities, it is possible for a single captured piece to be listed as being captured twice.

Steps to reproduce:

  1. Start the activity named "Play chess against your friend"
  2. Click the button that toggles displaying the captured pieces
  3. Play a sequence of moves in which a single piece is captured near the beginning of the sequence
  4. Undo all those moves
  5. Redo all those moves by quickly clicking the redo button

Expected behavior:
There is exactly one piece shown as being captured. See the following image for an example. In particular, there are 7 black pawns on the board and 1 black pawn displayed as captured.

Actual behavior:
There is more than one piece shown as being captured. See the following image for an example. In particular, there are 7 black pawns on the board and 2 black pawns displayed as captured. That is a total of 9 black pawns, which is impossible. Furthermore, this image is identical to the previous image except there is an additional black pawn displayed as captured.

tysonwilliams updated the task description. (Show Details)
tysonwilliams updated the task description. (Show Details)
jjazeix claimed this task.Oct 4 2020, 1:28 PM
jjazeix added a subscriber: jjazeix.

Can reproduce this time :).
I'll add a small timer before being able to click again the button.
There is no reason to spam the undo/redo buttons

There is no reason to spam the undo/redo buttons

My kids encounter so many bugs in Ubuntu by violating assumptions like this, and I never know how to reproduce the problem. This is especially true of my 4 year old. He can't read yet, so he uses trial and error to figure out how to make modal dialogs disappear (and I don't have speakers on the computer they use, so he can't use audio clues either). As I watch them nativage around, I imagine if I were the one that created the program, and I constantly think to myself, "Oh, I would never have tested that type in interaction".

Actually, here is an argument for currently spamming the undo button.

After one of my 6 year olds finishes a chess game, he often wants to show it to me. To do this, he "spams" the undo button until the game is in the initial state again. Then he slowly clicks the redo button while giving me play-by-play (i.e. "Then I moved my queen. Then he moved his king. Then I thought, I should get another queen, so I moved this pawn. ...)

He wouldn't have to spam the undo button if there was also an "undo all" button.

There is no reason to spam the undo/redo buttons

My kids encounter so many bugs in Ubuntu by violating assumptions like this, and I never know how to reproduce the problem. This is especially true of my 4 year old. He can't read yet, so he uses trial and error to figure out how to make modal dialogs disappear (and I don't have speakers on the computer they use, so he can't use audio clues either). As I watch them nativage around, I imagine if I were the one that created the program, and I constantly think to myself, "Oh, I would never have tested that type in interaction".

Yes, I never said it was a bad thing to do, and that's why we made a fix to prevent the bug :).

Actually, here is an argument for currently spamming the undo button.

After one of my 6 year olds finishes a chess game, he often wants to show it to me. To do this, he "spams" the undo button until the game is in the initial state again. Then he slowly clicks the redo button while giving me play-by-play (i.e. "Then I moved my queen. Then he moved his king. Then I thought, I should get another queen, so I moved this pawn. ...)

He wouldn't have to spam the undo button if there was also an "undo all" button.

We can't add a "undo all" (at least for this release), but I removed the "spamming" on undo as it didn't cause any issue.

I have verified that this is fixed. Great work! :)