How to handle changes to hydrated state schema with existing app installs? #2613
Labels
pkg:hydrated_bloc
This issue is related to the hydrated_bloc package
question
Further information is requested
Apologies if this was asked before...
I'm using HydratedCubit to persist state and wanted to get feedback on how to handle changes to the state schema with existing installed apps.
The first question is does hydrated state data persist between app re-installs (updates)? Meaning if I publish a new version of the app and the user installs, will it attempt to load the existing state data from local storage set by the previous version of the app?
If so, the issue for me is that if the new version of the app for example added a new field to the state, the fromJson will fail since this new field wouldn't exist in the state data in local storage.
One solution is to make my fields nullable so the fromJson doesn't fail, but that doesn't solve other changes, such as changes to existing fields types, etc..
Just curious if anyone has dealt with this scenario and has some suggestions.
thanks!
The text was updated successfully, but these errors were encountered: