Skip to content

Bug: fromCallback is not cleaning up after onError of child states #5433

@alita-moore

Description

@alita-moore

XState version

XState version 5

Description

I am designing a helper that basically enables the use of fromPromise to be stateful for use in react.

Expected result

When an error occurs in the Invoking Actor state I expect the error to propagate and the signal listener to cleanup its state.

Actual result

the listener stays subscribed sending update events to the stopped actor.

Reproduction

https://stackblitz.com/edit/vitejs-vite-hg1apcsw

Additional context

in the repro, hit "refresh" until an "error" occurs. And then notice that the console complains about the stopped actor.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions