State / Action sanitizer refactoring/bugfix + options fix #855
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The new state / action sanitization feature added by #544 and #795 has a bug:
This may now be an edge case, but, if the persist feature would get implemented (which under the hood is basically export/import), it may occur very often.
This is because the redux devtools extension does not know about any sanitizedActionsById object and will not update that. But the ngrx devtools reducer relied on this getting updated. This PR moves the state / action sanitization out of the reducer into the DevtoolsExtension service. Now, the sanitization is done directly before passing the state updates to the redux devtools extension. This makes the code more clear and fixes that bug.
During this I noticed that the options object which is handed to the devtools extension on startup is different to the options object which is sent on a full state replacement. Fixed that, too.
No worries on the big added/removed lines count in the store.spec.ts btw, I only removed the now obsolete tests for sanitizedActionsById, but for some reason git made that into a "replaced the whole file"-commit.