redux-persist icon indicating copy to clipboard operation
redux-persist copied to clipboard

Fallback with getStoredStateV4 when getStoredStateV5 promise is rejected

Open wouterds opened this issue 6 years ago • 3 comments

We're using redux-persist-filesystem-storage as storage provider for our React Native project and we've been trying to upgrade for a while, however we weren't able to migrate our state from v4 to v5 so far. I finally took some time to investigate why the state migration was not working and it turns out something throws inside getStoredStateV5.

This happens only first time if the key of the new store doesn't exist yet. As the promise rejection is not handled, and the next run the new store will exist, it is never populated with the old state from the v4 store. Anyway, here's the fix!

wouterds avatar Aug 13 '19 09:08 wouterds

Ideally there is a 5.10.1 release with just this commit on top of 5.10.0 so people can safely upgrade to v5 while v6 is still pending.

wouterds avatar Aug 13 '19 09:08 wouterds

Have you had time to review this @rt2zz? Would prefer to get rid of my fork asap and switch back to upstream.

wouterds avatar Sep 03 '19 12:09 wouterds

OK

wouterds avatar Jul 13 '20 08:07 wouterds