-
Notifications
You must be signed in to change notification settings - Fork 199
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
Local data gets lost on DataStore migration #1593
Comments
Thanks @valzevul! |
hey @valzevul @dsaliberti, |
Hi @diegocstn, thanks for the heads up! Good to know that this is on the roadmap, in the meantime I managed to temporarily address it on my side, although I don't yet know how reliable would that approach be:
It seems to do the job but I guess there might be some edge cases I have missed (also relying on the private table might be less from ideal). |
Any good news on this one please? 😃 |
One may wonder what real-world use cases is the Amplify Datastore designed for. To my knowledge, the offline-first solutions consider offline scenarios as their primary goal which means the local data should be treated as important and not just being thrown away. |
@valzevul Would it be possible for you to share the parsing code of the internal amplify db table? |
@fzy-spyro I've added a slightly simplified gist here, do let me know if there are any questions. |
@valzevul Hi, I am using iOS app and I faced the same issue now. Do you know the file path from where we can get the local amplify DB data. I saw your file, you used URL for dataStoreLocalCopyURL.absoluteString But I downloaded the app container and I am unable to see any amplify file in it. Can you please help with this? |
Describe the bug
Hey folks, every time models for Amplify are regenerated,
let version
inamplify/generated/models/AmplifyModels.swift
changes (which is expected).However, whenever I update the app, Amplify SDK compares the versions and if they are different migrates the database by removing the local copy and running a full sync against the remote copy.
This process doesn't trigger conflict resolution flows and docs mention that local migrations are not supported.
If that's the case, what are the best practices around the process? The app I am working on is offline-forward, so when users update there is a high chance they have lots of data not yet pushed to the servers, and losing it is less than ideal.
If that could be solved by selective sync (i.e as mentioned in #867), is there any timeline on its introduction to the iOS SDK?
Steps To Reproduce
Expected behavior
The developer gets a chance to manually migrate / push uncommited changes.
Amplify Framework Version
1.18.1
Amplify Categories
DataStore
Dependency manager
Cocoapods
Swift version
5
CLI version
4.5.0
Xcode version
13.0
Relevant log output
No response
Is this a regression?
No
Regression additional context
No response
Device
iPhone 13 Pro - Simulator
iOS Version
iOS 15
Specific to simulators
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: