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

Stop calling exit actions on stop #4377

Merged
merged 3 commits into from
Oct 20, 2023
Merged

Conversation

Andarist
Copy link
Member

It's important for rehydration. A stopped aka persisted machine can't call its exit actions if we don't call entry actions later on when rehydrating that state. And we can't call those entry actions because we have no sensible event to call them with. In addition to that - the whole persisting/rehydrating cycle should be mostly transparent to the user and if we call those actions it's no longer transparent.

Originally, we only started to call those actions in this situation because it was what SCXML mandated. It didn't come from a user request.

@changeset-bot
Copy link

changeset-bot bot commented Oct 20, 2023

🦋 Changeset detected

Latest commit: ffd5cc4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
xstate Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codesandbox-ci
Copy link

codesandbox-ci bot commented Oct 20, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit ffd5cc4:

Sandbox Source
XState Example Template Configuration
XState React Template Configuration

Copy link
Member

@davidkpiano davidkpiano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have a changeset for this?

Base automatically changed from fix/exit-actions-called-too-many-times to next October 20, 2023 13:45
@Andarist Andarist force-pushed the stop-calling-exit-actions-on-stop branch from 4dec2cf to 43557df Compare October 20, 2023 13:46
@Andarist Andarist merged commit 14cb2ed into next Oct 20, 2023
1 of 2 checks passed
@Andarist Andarist deleted the stop-calling-exit-actions-on-stop branch October 20, 2023 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants