I stumbled upon a case where pending transitions are a problem for me. As state A requests to exit with fsm.StateCanExit();, the FSM switches to the wrong state because of a pending transition. The condition for the pending transition is outdated, so it switches to the wrong state. It gets outdated because state A modifies the state that the condition is testing right before calling fsm.StateCanExit(), but the condition still triggers because it's "pending".
I could add extra checks to the transition but I was wondering if there's a better way to avoid this issue.
I stumbled upon a case where pending transitions are a problem for me. As state
Arequests to exit withfsm.StateCanExit();, the FSM switches to the wrong state because of a pending transition. The condition for the pending transition is outdated, so it switches to the wrong state. It gets outdated because stateAmodifies the state that the condition is testing right before callingfsm.StateCanExit(), but the condition still triggers because it's "pending".I could add extra checks to the transition but I was wondering if there's a better way to avoid this issue.