I can't find any cause for this yet. It works fine in development, but not at all in production. Maybe once I've gotten it to persist.
I've got timeout set to 0 and I've tried an empty and non-empty string for keyPrefix, but no luck still. I'm using AsyncStorage. Manually examining the database shows that the data does not seem to be stored anymore.
It seems that the state will persist if the amount of data is small (less than 10kb?) and the amount of time between closing and re-opening is enough, maybe 10 seconds?
Unfortunately at 1-2mb on Android no amount of waiting results in persisted data. It's always reset.
I've now tried blacklist, whitelist and excluding both options and simply saving everything, but the problem persists.
On a Pixel 2 running Android 9 it looks like 1800kb is about the limit for what Redux-Persist will restore with any amount of waiting. At 2000kb the data is lost 100% of the time.
Try some other storage engine, for example https://github.com/robwalkerco/redux-persist-filesystem-storage
See #199 and #284.
Unfortunately nothing else is compatible with Expo so I had to ditch Redux-Persist. I'd love to know why this is an issue though.
@Slapbox
i know this is a bit late, but would you mind testing this gist if it's still relevant?
have only tested it with apollo-cache-persist so i would love to know if this is a viable solution for this case as well
Hey @bureyburey we abandoned redux-persist because this issue made it unusable in our case. I won't have time to test, apologies.
No worries @Slapbox
Was just curious whether this will work or not.
Maybe i'll make a poc if i have the time