Skip to content

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

Merged
brandonroberts merged 1 commit into
ngrx:masterfrom
AdditionAddict:pr/fix_data_undo_many
Feb 8, 2020
Merged

fix(data): make undoMany remove tracking changes in changeState (#2346)#2352
brandonroberts merged 1 commit into
ngrx:masterfrom
AdditionAddict:pr/fix_data_undo_many

Conversation

@AdditionAddict

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

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

@ngrxbot

ngrxbot commented Feb 6, 2020

Copy link
Copy Markdown
Collaborator

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

@brandonroberts

Copy link
Copy Markdown
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