rt2zz / redux-persist

persist and rehydrate a redux store
MIT License
12.96k stars 865 forks source link

Redux store in some cases erased #1105

Open dylancom opened 5 years ago

dylancom commented 5 years ago

It seems that when rehydration fails, all the state is being reset to initialState. In my app users can save playlists and settings and some users reported that they lost all their data suddenly.

I've already tried setting timeout to 0 (recommended by some devs) but the bug is still being reported.

My persistConfig: const persistConfig = { key: 'root', storage, timeout: 0, whitelist: ['library', 'settings'] }

ItsNoHax commented 5 years ago

@dylancompanjen If you are using AsyncStorage you are hitting the sqllite database limit of a single string.

dylancom commented 5 years ago

@ItsNoHax yes i'm using AsyncStorage, is that also the case on iOS?

ItsNoHax commented 5 years ago

No, the implementations are different per OS. Basically make sure you either don't have such a big redux store (not sure what data you store atm) or use an alternative storage engine (Realm for example)