xstate
xstate copied to clipboard
Bug: when using invoked actors in a top-level final state, error should be shown
Description
I spent a lot of time debugging this issue. Had a final state with an invoked actor. It would start executing the invoked actor but not report any errors to onError.
Expected result
To see a warning or an error
Actual result
It let me shoot myself in the foot for a couple hours straight.
Reproduction
https://stately.ai/viz/42973d38-455d-44d5-93a9-8a8d323d5283
Additional context
No response
You're right; final states should not have invoked actors, which matches the SCXML spec: https://www.w3.org/TR/scxml/#final
We should warn against this and/or disallow this in v5.