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(data): make undoMany remove tracking changes in changeState (#2346) #2352

Merged
merged 1 commit into from
Feb 8, 2020
Merged

fix(data): make undoMany remove tracking changes in changeState (#2346) #2352

merged 1 commit into from
Feb 8, 2020

Conversation

AdditionAddict
Copy link
Contributor

Fixes #2346

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ x ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

UNDO_ONE and UNDO_MANY actions reverts one/many entities back to their original state but changeState keeps the tracking the entity/entities.

Closes #2346

What is the new behavior?

UNDO_ONE and UNDO_MANY actions remove the entity/entities from changeState as well as the current behavior of reverting the entities state.

Does this PR introduce a breaking change?

[ ] Yes
[ x ] No

Other information

This would be my first ever PR if accepted.

Please confirm if PR is intended behavior before accepting.

Reference https://ngrx.io/guide/data/entity-change-tracker#removing-an-entity-from-the-changestate-map

The undo operations replace entities in the collection based on information in the changeState map, reverting them their last known server-side state, and removing them from the changeState map. These entities become "unchanged."

@AdditionAddict
Copy link
Contributor Author

Does Documentation refer to answering the PR questions or the actual website documentation?

@ngrxbot
Copy link
Collaborator

ngrxbot commented Feb 6, 2020

Preview docs changes for 04658a5 at https://previews.ngrx.io/pr2352-04658a5/

@brandonroberts
Copy link
Member

@AdditionAddict it refers to website documentation. From the excerpt, it seems that this fixes the behavior described there.

@brandonroberts brandonroberts merged commit 637b2c7 into ngrx:master Feb 8, 2020
@AdditionAddict AdditionAddict deleted the pr/fix_data_undo_many branch February 11, 2020 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@ngrx/data/save/delete-one/error does not remove the change from the changeState
4 participants