FrozenCanuck/Ki — Issue #35: gotoState(x) when x is the current state shouldn't do anything
Author: williamcoates
Created: 2011-10-12 07:57:21+00:00
State: open

I have a simple statechart used for authentication. It has one root state, with multiple substates such as 'loggedIn'.

If the statechart is currently in state 'loggedIn' and i call gotoState('loggedIn'), it runs exitState() and enterState() for the 'loggedIn' state, which seems like the wrong behaviour: if the statechart is already in that state it shouldn't run any state transitions!

This means that in our code, we always have to check that the current state isnt equal to the one we are transitioning to, in order not to run any superfluous transitions.