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

Fix update block attributes shallow clone comparison #1995

Merged
merged 1 commit into from
Jul 24, 2017

Conversation

aduth
Copy link
Member

@aduth aduth commented Jul 24, 2017

This pull request seeks to resolve an issue where block attributes were not correctly considering strict equality of current vs. previous attribute sets. This resulted in the reducer mutating state directly, which did not have an immediately noticeable effect, except uncovered in an in-progress pull request which relied on immutability of state.

Tests have been revised to apply deepFreeze to original state, which reveals the original error. Further, a new test case has been added to ensure that the shallow clone is performed correctly when accumulating (merging) attributes.

Testing instructions:

Ensure that unit tests pass:

npm test

Verify with Redux DevTools Extension that when changing then blurring a Classic Text block, the Diff tab includes the updated content attribute for the UPDATE_BLOCK_ATTRIBUTES action.

@aduth aduth added the Framework Issues related to broader framework topics, especially as it relates to javascript label Jul 24, 2017
Copy link
Member

@nylen nylen left a comment

Choose a reason for hiding this comment

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

Confirmed the bug and the fix.

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants