vstirbu/fsm-as-promised

Previous transition pending

yarandoo opened this issue · 4 comments

Hi,

We are receiving a very sporadic issue in our logs:

'Previous transition pending. Options received: {"name":"archive","from":"IN_USE","to":"ARCHIVED","args":[]}',

I wonder which is the cause of this, as this is a very simple event: "Archive". And it is working 99% of the times. (Only changing the state and persisting it into the DB).

{ from: states.IN_USE, to: states.ARCHIVED, name: 'archive' },

We have multiple instances of the same stateMachine definition, in memory, at the same time. Is there any reason that one state machine instance can be conflicting with the state of a different state machine?

Any ideas on this weird behaviour would be appreciated.

In the underlying implementation is there any state shared across the different state machine instances that could be affecting this?

There is no shared state between the state machine instances.

It seems that a previous transition has not completed before you do the archive. Can you share more about what happens in the IN_USE state?

Can you check to run:

console.log(fsm.can('archive'));
fsm.archive();

just to rule out any pending transitions.

Thanks for answering.

In this particular case, IN_USE is the initial state of the machine as we just loaded the state from the DB. After initializing the machine, archive is the first event that is called. Very simple use case.

Will add some debug logs to have some more info as you suggested. Thanks.

Please reopen if you have more details