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

State: Deduplicate notices by distinct ID #3764

Merged
merged 1 commit into from
Dec 3, 2017
Merged

Conversation

aduth
Copy link
Member

@aduth aduth commented Dec 2, 2017

This pull request seeks to update the behavior of notices reducer to respect ID as a unique identifier, removing duplicate entries. The revised behavior appends the latest notice as the last value in the set, removing any prior entries which share the same ID.

Testing instructions:

Ensure that unit tests pass:

npm run test

Currently there do not appear to be any situations in which a duplicate notice would be shown, only because the behavior of saving explicitly calls to remove the existing notice.

dispatch( removeNotice( SAVE_POST_NOTICE_ID ) );

However, this has shown to be an issue in #3378 where saving a reusable block displays a notice with a common ID.

@aduth aduth added the Framework Issues related to broader framework topics, especially as it relates to javascript label Dec 2, 2017
@codecov
Copy link

codecov bot commented Dec 2, 2017

Codecov Report

Merging #3764 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3764   +/-   ##
=======================================
  Coverage   37.67%   37.67%           
=======================================
  Files         279      279           
  Lines        6737     6737           
  Branches     1226     1226           
=======================================
  Hits         2538     2538           
  Misses       3538     3538           
  Partials      661      661
Impacted Files Coverage Δ
editor/reducer.js 90.37% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c4444e4...98e59be. Read the comment docs.

@aduth aduth merged commit 429fb42 into master Dec 3, 2017
@aduth aduth deleted the update/distinct-notices-id branch December 3, 2017 14:52
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