Skip to content
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

First event with nested machine as a first state is missed #138

Open
NastyaLo opened this issue Jan 11, 2021 · 1 comment
Open

First event with nested machine as a first state is missed #138

NastyaLo opened this issue Jan 11, 2021 · 1 comment

Comments

@NastyaLo
Copy link

NastyaLo commented Jan 11, 2021

In nested machines an event is needed to fall throught to start interact with a child machine.

When we have a child machine as a first state of a parent machine - initially we are in the parent machine. If we want to send an event to the child machine - we need to send any event to the parent machine. Only after that child machine will receive events.

There is a small example that reproduses the issue: https://codesandbox.io/s/robot3-react-nested-example-8dtcd

Is that expected behavior?

@NastyaLo NastyaLo changed the title First state as child weird behavior First event with nested machine as a first state is missed Jan 11, 2021
@Zearin
Copy link
Contributor

Zearin commented Jun 20, 2021

Yeah, I can see how this is confusing.

  • Maybe this is just the expected behavior of Robot (in which case the docs should be updated to note “Robot will never immediately transition to a child machine; write your code accordingly”); OR,
  • Maybe there is a way to get this to behave as you want using immediate(); OR
  • …Maybe it’s just a bug!

@matthewp Could you advise on how to proceed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants