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

Store: Mutate editor store reference in middlewares application #5229

Merged
merged 1 commit into from
Mar 2, 2018

Conversation

aduth
Copy link
Member

@aduth aduth commented Feb 23, 2018

Extracted from #5228

This pull request seeks to resolve an issue where side effects are ignored when dispatching to the registered editor store. Because middlewares are applied to the editor store in a non-mutative fashion, the editor module itself uses a different dispatch reference from external modules. Therefore, if an external module attempts to dispatch an action on the core/editor namespace which has a side-effect attach, the effect will not be triggered.

Testing instructions:

This was observed in #5228 where, after updating to use withDispatch, it was observed that triggering fetchReusableBlocks would not actually fetch the blocks because the effect behavior was not triggered.

@aduth aduth added the Framework Issues related to broader framework topics, especially as it relates to javascript label Feb 23, 2018
@aduth aduth force-pushed the fix/editor-store-mutate-middleware branch from 0f505b0 to 834104a Compare February 28, 2018 15:36
@aduth aduth added this to the 2.3 milestone Feb 28, 2018
@aduth aduth added the [Priority] High Used to indicate top priority items that need quick attention label Feb 28, 2018
@aduth
Copy link
Member Author

aduth commented Feb 28, 2018

Adding to 2.3 milestone, as I'm observing that this incidentally resolves an issue where edit-post effects are not being respected, meaning the meta box initialization does not initialize data and therefore is causing a post with meta boxes to always prompt when attempting to navigate away.

@aduth aduth merged commit 328a859 into master Mar 2, 2018
@aduth aduth deleted the fix/editor-store-mutate-middleware branch March 2, 2018 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Framework Issues related to broader framework topics, especially as it relates to javascript [Priority] High Used to indicate top priority items that need quick attention
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants