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

Fixed bug when changing number of Latests Posts rapidly was leading to some numbers being defunct. #4335

Merged
merged 1 commit into from Jan 8, 2018

Conversation

Projects
None yet
2 participants
@jorgefilipecosta
Member

jorgefilipecosta commented Jan 5, 2018

Fixes: #4328

Latest posts block was using splice operation changing the original data array passed to it. This data array was the same being used in withAPIData cache leading to the cache being corrupted, so when returning to the same number of posts that were cached some posts were deleted.

How Has This Been Tested?

Increase and decrease the number of latest posts to show very fast (easy to with up&down keys) verify the number of posts being show is always the expected one and problems described in #4328 are not happening.

Latest posts: Fixed bug when changing number of Latests Posts rapidly…
… was leading to some numbers being defunct.

Latest posts block was using splice operation changing the original data array passed to it. This data array was the same being used in withAPIData cache leading to the cache being corrupted, so when returning to the same number of posts that were cached some posts were deleted.
@youknowriad

Good catch. 👍
The danger of mutability :)

@jorgefilipecosta jorgefilipecosta merged commit 82ce047 into master Jan 8, 2018

3 checks passed

codecov/project 39.82% (-0.03%) compared to 402c7df
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@jorgefilipecosta jorgefilipecosta deleted the fix/latest-posts-number-posts-show branch Jan 8, 2018

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