-
Notifications
You must be signed in to change notification settings - Fork 862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Store with AsyncStorage storage not rehydrating #244
Comments
can you add log: true to autoRehydrate: autoRehydrate will skip rehydration if you handle the action in your reducer. Double check that you are not modifying state in your default action handler in your reducers. The log on autoRehydrate may give us some hints here. |
Good call on the logs, here's what I get from the log, what should I be looking for? redux-persist/autoRehydrate: 1 actions were fired before rehydration completed. This can be a symptom of a race
condition where the rehydrate action may overwrite the previously affected state. Consider running these actions
after rehydration: |
Re: modifying state, does something like a lodash |
BTW, no actions are listed after the above message from redux-persist. |
I 'fixed' this by adding my own reducer. Still unsure why it didn't work. Should I close this? The issue still exists... case 'persist/REHYDRATE':
// only do this if offline
if(typeof Meteor.ddp === undefined || Meteor.ddp.status === "disconnected"){
return action.payload;
} |
@JulianKingman sorry for the delay in getting back to you. The log warning you mentioned here: #244 (comment) was actually a false alarm in the debug logic, that has now been fixed. Yes _.update would result in state being modified and hence autoRehydrate skipping. In this case I think your solution is reasonable. I am working on a way to make this immutability implementation detail more apparent to consumers, but for now I think things have to be dealt with on a case by case basis. |
I have a store that I'm persisting with AsyncStorage, but it doesn't seem to be rehydrating. The callback fires, but getState comes up empty. If I get the values of AsyncStorage, however, I can see that it is being persisted, just not rehydrated. Thoughts?
The text was updated successfully, but these errors were encountered: