Description
Given two paralell states (One and Two) where One has an invoke and an event listener, and Two has an event listener listening for the same event, the state chart will break if:
a) One uses the RAISE action when the event is fired AND
b) Two enters a new state with another invoke.
It won't break if One doesn't have an invoke or if the raise action inside One is replaced with "target" instead.
Expected Result
Firing off the shared event should cause Two to change state and invoke the function inside the new state.
Actual Result
The new state is entered by Two correctly but the invoke inside it doesn't run.
Reproduction
https://xstate.js.org/viz/?gist=45e5d6c7bbfb08a575e0c8aa2f5af942
1) Open the visualizer and inspect the console.
2) Click "SOMEEVENT" and see that the visible state goes to hidden and the Idle state goes to newstate. Also observe that the console log "ENTERED" appears but the console.log for "This never fires" doesn't show up.
Now comment out "actions : raise('HIDE')" and uncomment "target : 'hidden".
Do the same steps as above but this time both "ENTERED" and "This never fires" should show up in the console.
Additional context
"xstate": "^4.8.0"
/CC @tivac
Thanks for reporting this with a repro case - I'm going to investigate this 馃敎 and hopefully provide a fix for it.
Most helpful comment
Thanks for reporting this with a repro case - I'm going to investigate this 馃敎 and hopefully provide a fix for it.