-
Notifications
You must be signed in to change notification settings - Fork 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
Posts: Remove PostCountsStore Flux store #4875
Conversation
Already encountering at least one regression with how we were previously optimistically handling changes to posts in the counts store. Trashing a post in this branch does not increment counts accordingly in the navigation bar. We could explore cherry-picking pieces from #4557 for incrementing counts on the trash (publish, etc) actions. |
@aduth perhaps it's wise to finish moving to |
Even at that point, if we want to preserve the optimistic updating of post counts, we'll still probably want to explicitly dispatch an action to increment the counts from the trash button callback. More broadly to this point, #4557 has uncovered some difficult complexities in managing post state in response to changes, which we haven't encountered to this point. Specifically around managing reducer relations between different parts of the tree, which is frowned upon / not obviously possible. So it's not as simple as I'd hoped in adding a handler for post change actions to the counts reducer, since we can't know the previous item's state from that reducer. |
Wonder if we could keep track of local count modifications separately and use them to modify output of selectors |
I'll need to look again, but there are a few more complications, especially around (a) having two-step trashing for posts and (b) knowing the previous status for a post (not just incrementing count for trashed, but also decrementing count for current/previous status). |
We should probably plan to revive this pull request in the near future, seeing as currently we're making duplicate redundant requests for post counts on the post listing screen (drafts list |
Closing as older and possibly abandoned. Feel free to re-open if still valid and in-progress. |
This pull request seeks to migrate the remaining single component using
PostCountsStore
Flux store to use Redux post counts state,<PostsNavigation />
.Testing instructions:
Verify that posts navigation continues to behave as it did previously, with and without Redux state persistence (disable by restarting Calypso with
DISABLE_FEATURES=persist-redux make run
).Specifically:
<SectionNav />
)Ensure that no remaining references to post counts Flux store remain. I did note a remaining
&meta=counts
query parameter in the sync handler test data, but this was not easily removed (assumed hash generated by query parameters).