This repository has been archived by the owner on Feb 25, 2024. It is now read-only.
Bug: Leaving nested paralell states when target is non-empty leads to inconsistent state #404
Labels
bug
Something isn't working
Description
Consider this statemachine:
https://stately.ai/viz/f24c571d-0e9d-4562-9d18-d7a8f2a30890
The state machine contains two big states,
ping
andpong
, and transitionsPING
andPONG
between them.pong
contains parallel states, one of which just flip/flops uponPING
andPONG
signals. The other state (idle
) wants to leavepong
and go toping
uponPING
. That transition has the following problem: when the target (ping
) contains no child state, the whole machine works as I would expect, with eitherping
orpong
being active. Ifping
does have a child state (commentMe
), the transition is taken, but theflipFlop.flip
state is somehow also kept active, so nowping
ANDpong
are active, even though they are not in parallel relationship. TriggeringPING
a second time does get us to the intended state.Unless I missed something in the docs, the behavior of the statemachine, as linked, is broken IMO, but can be made to work by commenting the
commentMe
state.Expected result
Leaving state with nested parallel states would make all parallel states inactive.
Actual result
In case of the transition target containing children, leaving the state with nested parallel states can leave some of these active.
Reproduction
https://stately.ai/viz/f24c571d-0e9d-4562-9d18-d7a8f2a30890
Additional context
No response
The text was updated successfully, but these errors were encountered: