-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Ensure actions are executed from a restored initial state. #1183
Conversation
🦋 Changeset is good to goLatest commit: 5b0c2f4 We got this. This PR includes changesets to release 7 packages
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 |
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 5b0c2f4:
|
I'm having second thoughts - actions are being considered fire and forget, so this is very likely that actions for a particular state has already been executed and only after that the state has been persisted and rehydrated later. In such a case action would be fired twice - which is not necessarily always a good thing. It should be up to a developer to decide about this because we don't know what's their strategy for persistence & rehydration. |
Regardless, this PR is still correct, because there is a bug where actions aren't being resolved correctly, even though they should. The fix is general. The behavior of whether or not those resolved actions should be executed is a separate issue, but I agree, it should be addressed. |
👌 |
The issue was that when restoring from an initial state,
state.actions
weren't being resolved against the specifiedmachine.options.actions
action mapping, so actions weren't being executed.Fixes #1174