fix(ui): return wrapped history in redux-remember unserialize #8317
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.
Summary
We intermittently get an error like this:
This error is caused by a
redux-undo
-enhanced slice being rehydrated without the extra stuff it adds to the slice to make it undoable (e.g. an array ofpast
states, thepresent
state, array offuture
states, and some other metadata).redux-undo
may need to check the length of the past/future arrays as part of its internal functionality. These keys don't exist so we get the error. I'm not sure why they don't exist - my understanding ofredux-undo
is that it should be checking and wrapping the state w/ the history stuff automatically. Seems to be related toredux-remember
- may be a race condition.The solution is to ensure we wrap rehydrated state for undoable slices as we rehydrate them. I discovered the solution while troubleshooting #8314 when the changes therein somehow triggered the issue to start occuring every time instead of rarely.
Related Issues / Discussions
This has popped up intermittently but I can only find 1 example in GH.
QA Instructions
Should be zero functionality changes. Not sure how to reproduce the issue.
Merge Plan
n/a
Checklist
What's New
copy (if doing a release after this PR)