You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[SOME_EVENT]: {
// this will throw an js error
const a = undefined;
console.log(a.b);
}
}
And I can successfully subscribe the error by following the official doc
error: (err) => {
// can catch the error here
console.error(err);
// but this event will no longer be received by the child1 actor
child1Actor.send({ type: 'SOME_EVNET2' })
}
})
But the strange thing is the child1 actor seems has crashed and no longer be able to receive any events.
I don't know if it is a reasonable behavior as I haven't found related description in official docs about the behavior of an actor after throwing js error. But my understanding is: since I catch the error, the actor should still be working.
Expected result
Expected the child1 actor can still be alive and able to receive events normally even after throwing an js error
Actual result
the child1 actor seems has crashed and no longer be able to receive any events.
betterRunner
changed the title
Bug: spawn actor on logger live after throwing an js error
Bug: spawned actor on logger be alive after throwing an js error
Sep 20, 2024
betterRunner
changed the title
Bug: spawned actor on logger be alive after throwing an js error
Bug: spawn actor on logger be alive after throwing an js error
Sep 20, 2024
XState version
XState version 5
Description
Hi there, I made an experiment to test if a child spawn actor can restore nornal status after throwing an error, here is the process:
I don't know if it is a reasonable behavior as I haven't found related description in official docs about the behavior of an actor after throwing js error. But my understanding is: since I catch the error, the actor should still be working.
Expected result
Expected the child1 actor can still be alive and able to receive events normally even after throwing an js error
Actual result
the child1 actor seems has crashed and no longer be able to receive any events.
Reproduction
https://codesandbox.io/p/devbox/github/statelyai/xstate/tree/main/templates/vanilla-ts
Additional context
No response
The text was updated successfully, but these errors were encountered: