mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-02-13 05:34:58 -05:00
We intermittently get an error like this: ``` TypeError: Cannot read properties of undefined (reading 'length') ``` 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 of `past` states, the `present` state, array of `future` 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 of `redux-undo` is that it should be checking and wrapping the state w/ the history stuff automatically. Seems to be related to `redux-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.