• Follow our Instagram!
  • Curious about what we're currently doing about bots? Check out the latest updates from staff in this thread.

Done Bug Report - Client

xsus

formerly kyuss
is a Tiering Contributor
What type of bug are you reporting?
Client

What is the bug?
When I select an action and then press Cancel before my opponent has chosen, the cancelled action is still executed. The action I chose after cancelling is not executed that turn but carries over and is executed automatically on the next turn, without letting me choose.

Example: https://replay.pokemonshowdown.com/gen9pu-2706936292-8g41ero7uui4pnam5v6kod7uyppsafwpw

Around turns 4 to 6, I initially clicked to switch from Pawmot to Piloswine, then cancelled and instead selected Double Shock with Terastallization on Pawmot. The switch to Piloswine went through anyway. On the following turn I got no chance to pick a move: Piloswine Terastallized and used its 3rd move, which is in the same slot as Double Shock on Pawmot. So the move and Tera from my second choice were applied to whichever Pokémon was active the next turn.

Upload an image of the bug if necessary
(no response)

Are you able to replicate it? If so, how?
It has happened twice, I didn't save the first replay and haven’t tested it on purpose. The pattern seems to be:

1. During a battle, select any action.
2. Before the opponent makes their choice, press Cancel.
3. Select a different action.
Result: the first (cancelled) action is executed that turn. The second action is then executed automatically on the next turn, with no option to choose.

In the linked replay, the first action happened to be a switch to Piloswine and the second was Double Shock with Tera on Pawmot. The switch went through, and the next turn Piloswine Terastallized and used its 3rd move (same slot as Double Shock) without my input. I don’t think the switch or Tera is required; that’s just what I clicked in this case.
 
This is caused by lag. Your cancel was not received by the server in time to actually cancel the action, but your next action was also delayed enough it was treated as a decision for the following turn.
 
This is caused by lag. Your cancel was not received by the server in time to actually cancel the action, but your next action was also delayed enough it was treated as a decision for the following turn.
Thanks, that makes sense for the cancel. Should a decision sent for one turn be accepted for the next one, though? In my case it applied a move and Tera to a different Pokemon that I never chose them for. Rejecting stale decisions and asking me to choose again would avoid this.
 
Last edited:
Well, moves are parsed as slot actions, like /choose move 4 terastallize, not direct actors (i.e. Magikarp move splash, terastallize steel), so "fixing" this would require a refactor of how battle actions are sent and received (as the server can't tell exactly what pokemon you're acting as, only what slot of your active mons), which would be a huge undertaking.
 
Well, moves are parsed as slot actions, like /choose move 4 terastallize, not direct actors (i.e. Magikarp move splash, terastallize steel), so "fixing" this would require a refactor of how battle actions are sent and received (as the server can't tell exactly what pokemon you're acting as, only what slot of your active mons), which would be a huge undertaking.
Makes sense about slot-based actions. Wouldn’t tagging each choice with the turn it was made for be enough, though? The server could reject a choice meant for an earlier turn and ask again, without needing to know which pokemon it was for. Just a thought, thanks for looking into it.

obs: I’ve played on Showdown for about as long as it exists and never had this happen before, and now it’s happened twice in one week. That might point to something that changed recently rather than just my connection (using the new client btw). I’ve also had worse lag in other matches, where my timer kept running after I’d made a choice, and this didn’t happen in those. It wasn’t the case in the match I reported either.
 
xsus is right that we have a way to prevent commands from applying to the wrong turn, which was temporarily broken. Fixed now.

(The way it's supposed to work is that we invisibly send the turn number along with your choice, so it's automatically rejected if it doesn't match.)
 
Last edited:
Back
Top