xstate-devtools icon indicating copy to clipboard operation
xstate-devtools copied to clipboard

Invoking a machine as a service only shows the child machine while the parent is omitted

Open CodingDive opened this issue 5 years ago • 2 comments

Hey, I might've found another small bug. I have only tried to run it in Codesandbox so it might be related to #14. That being said, even when popping the window out, it only shows the invoked actor (rockPaperScissorsMachine) instead of both, the player machine (called ActorMachine in the sandbox) and the child.

Opening the devtools on https://mtm8y.csb.app/ shows:

image

I'm only passing devTools: true when the component starts the parent service as I don't think there is a way to enable dev tools explicitly on the child as it is being invoked.

You can find the sandbox here. This time, I didn't mess up and we can actually see the newest XState version in use 😄 😅

CodingDive avatar Dec 21 '19 22:12 CodingDive

This codesandbox which is a fork of the one I originally linked, only shows a single machine too. This time it shows the parent machine (game) while omitting the rockPaperScissors machine and player machine.

https://qce8n.csb.app/ image

CodingDive avatar Dec 23 '19 12:12 CodingDive

I see the issue now, it seems like the same one over at https://github.com/amitnovick/xstate-devtools/issues/10#issuecomment-563343011 (that issue thread has two different bugs it seems, the "circular references" one was already fixed, whereas the second one has a parent invoked service missing from the list).

Basically, for some reason, parent invoked services aren't being added to the services list 🤔

Will need to investigate to see why this is happening, but fortunately you've provided great reproductions so it's easier to pinpoint the problem. Thanks! will update when I have a solution.

amitnovick avatar Dec 23 '19 13:12 amitnovick