-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Migrate AsyncStorage to ReactNative (iOS), losing old data #5651
Comments
same issue here |
Edit: Updated the source code to handle AsyncStorage migration properly Hey guys, just in case any of you are still looking for a solution. I faced the same issue when I was rewriting my app from ExpoKit (SDK 31) to the bare Expo workflow and SDK 35. Here is a piece of code to give you an idea:
Disclaimer: please review it carefully and test it first and use it with caution. |
@burivuhster Hi, out of interest, have you tried this in TestFlight? |
@solace Yes, and the update with data migration code is in production since yesterday. But I enabled phased release, so only a couple of real users were updated to this moment. So far so good. |
@burivuhster Good to know, thanks. I'm trying to upgrade from SDK 32 to bare and I'm finding the data is lost when I attempt to inspect the ExponentExperienceData manifest file. It works fine in the simulator but on TestFlight there is no data. Did you follow a specific guide, or do you have steps for transitioning to bare? I feel like I'm missing something critical here that's causing the data to not be there. Switching back down to an older version shows the old data, so it's still there, just not accessible by the bare version. |
@solace I didn't find any guides, that's why I decided to share my experience here. Please note that AsyncStorage saves values in separate files when the value length is more than 1024 bytes. And it keeps a null value in manifest.json in this case. |
@burivuhster That note about AsyncStorage saving values in different files was the key to my issue. Thanks! |
This issue is stale because it has been open for 60 days with no activity. If there is no activity in the next 7 days, the issue will be closed. |
This issue was closed because it has been inactive for 7 days since being marked as stale. Please open a new issue if you believe you are encountering a related problem. |
🐛 Bug Report
I wanted to migrate from ejected Expo to the last react native version and figured out expo do not use the same directory path as ReactNative Core so migration from Expo to React Native Community result in a lost of my local stored data.
Here Expo directory name (@"RCTAsyncLocalStorage"):
expo/ios/Exponent/Versioned/Core/EXVersionManager.m
Line 348 in 15a7ff7
Here ReactNative Core directory name (@"RCTAsyncLocalStorage_V1"):
https://github.com/facebook/react-native/blob/ce0ad9f7121c70b1dd27508910156ecc95b6f10c/React/Modules/RCTAsyncLocalStorage.m#L20
Here ReactNative Community migration PR:
react-native-async-storage/async-storage@8d275ad#diff-54c57f4041d9a698ab027d21344b6e63
Why do you use @"RCTAsyncLocalStorage" instead of @"RCTAsyncLocalStorage_V1"?
Environment
Steps to Reproduce
Expected Behavior
Do not lose local stored data once migrated to https://github.com/react-native-community/async-storage.
Actual Behavior
Keep local stored data once migrated to https://github.com/react-native-community/async-storage.
Reproducible Demo
The text was updated successfully, but these errors were encountered: