Skip to content

Pending transitions causing problems #60

@lucypero

Description

@lucypero

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions