-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Machine exit actions have been called twice #2914
Comments
Have you tried with 4.27.0? This should have been just fixed there: https://github.com/statelyai/xstate/releases/tag/xstate%404.27.0 |
And may I ask your option for the exit order is not as same as the entry order problem?
I think the exit order should be exactly the reverse order of the entry, or do we have any reason that make those order like this? |
The exit actions order is being fixed here: #2903 |
Aha, brilliant! |
Description
I have a machine with two children: one is spawn-ed and the other is invoke-ed.
They all have
entry
andexit
actions which is a spy for testing.Expected Result
after the
interpreter.stop()
, the parent and two childrenexit
actions will be called once.Actual Result
They have been called twice instead of once.
Reproduction
https://github.com/wechaty/bot5-assistant/blob/ffb902ebfa2513630a92309ce9091a28c80dbdfc/src/mailbox/xstate-child-exit-order.spec.ts#L61-L68
Additional context
I want to do cleanup whenever the machine (actor) has been stopped.
One more thing: I noticed that the exit order is not the same as the entry order.
I think the exit order should be exactly the reverse order of the entry?
The text was updated successfully, but these errors were encountered: