Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Actions and services not invoked after transitioning back using history state #3640

Closed
rjdestigter opened this issue Oct 15, 2022 · 1 comment

Comments

@rjdestigter
Copy link
Contributor

Description

The machine receives a PING from an invoked callback and is supposed to transition to a refresh state that is of type history. The state it transitions back to does not re-invoke the service and actions defined for that state but does clean up the invoked callback.

I also have an entry action on the main machine for logging that's showing that the event is a null event (type is an empty string). In version 4.32 this is still xstate.init which is what I expected.

Both issues are not present in version 4.32

Expected result

  • Expected event of xstate.init to be passed to log action in avocado machine's booting.entry action.
  • Expect query machine to re-invoke avocadodItemsSubscription after moving back and forth between history node

Using the provided Codesandbox example:

Watch the console when it starts up
image

After clicking test which sends PING to the query machine:
image

I would expect these two logs again:
image

Actual result

The log action on entry logs an empty string as the event type rather than xstate.init
image

and the invoked child machine does not re-invoke the expected callback service and action after transitioning back from the history state.

Reproduction

https://codesandbox.io/s/still-bash-it7513?file=/src/App.tsx

Additional context

No response

@Andarist
Copy link
Member

This is fixed in both v4 and v5. I'm also adding a related test case here to ensure that we don't regress on this in the future

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants