You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I run into a problem because I have an 'onbeforecaptured' callback that ends up doing a call to the fsm to transition to another state before the callback is done.
It seems to result into the the FSM changing state once while within the callback, then changing state to the state that should normally happen at the end of the callback.
Is it possible to configure the FSM to catch and assert if a state transition is initiated while another transition is ongoing?
Would queuing the state transition to happen after the current callback is processed be desirable?
The text was updated successfully, but these errors were encountered:
your assertion makes sense, we don't check if we're still in the same state before performing the actuall transitions after callbacks have run.
I am unsure about queueing since this is quite complicated to do right. Also if a callback changes state there is no guarantee that it is still allowed when the state transition succeeds. For instance I would expect an onbefore callback to assume it ia in the previous state but if it wants to transition then it has to assume the transition has completed?
We could simply drop the current transition if a callback "escapes" the normal flow. Would this help you? Another possibility is to simply ensure the state did not change when completing the transition and if it did we don't mutate the state anymore.
I would like to quickly catch when my callbacks are causing this sort of nested state change. An assertion would be best for me, as I don't see a situation where I would ever want that.
I run into a problem because I have an 'onbeforecaptured' callback that ends up doing a call to the fsm to transition to another state before the callback is done.
It seems to result into the the FSM changing state once while within the callback, then changing state to the state that should normally happen at the end of the callback.
The text was updated successfully, but these errors were encountered: