-
Notifications
You must be signed in to change notification settings - Fork 582
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
Add option to exclude realm from iCloud backup #4139
Comments
@c-goettert Thank you for the suggestion. I see three possibilities:
I can't give a timeline for when we add it, but if you were to pick, which one of the three above would you prefer? |
Hi @kneth, thanks for the fast reply! |
Any updates on this? |
Since we memory-map the file, I'm not 100% certain what "save" means in our case, it might be required on every flush, which would likely be detrimental to runtime performance 🤔 But I don't think that would be required. If we want to follow the approach that react-native-async-storage and Realm Swift is using, it seems we only need to (optionally, based on the configuration) call into Swift code once when opening the Realm. |
Hi @kraenhansen, any updates on this ? Is there an easy workaround for now ? If I could get some pointers on how it works I could try and patch it for me project or open a PR |
This is not something we're actively working on.
You could write some Swift code in your app's namespace and call the relevant Apple APIs (see my link to RealmSwift above).
I'd be happy to accept a PR for this. We could call this Steps needed on the top of my head:
|
A fix for this was released in v12.14.0, enabled by setting Thanks a lot @danibonilha for your PR and time crafting the testing guide! |
The fix for this was picked onto the |
Problem
Some apps might want to exclude realm from the iCloud backup. Currently there is no configuration option to achieve this behavior. I am aware that there are manual ways to solve this, e.g. manipulating the resource keys of files created by realm. However, I can understand developers who would rather not make such adjustments, as they may not be able to fully understand the effects. E.g., Apple writes in the documentation about the corresponding NSURLIsExcludedFromBackupKey parameter:
It also feels to me that this option should be configurable via Realm itself, since Realm is a database with its own synchronisation capabilities. React Native Async storage for example offers a configuration option for this purpose. Also, I've seen that for some files there is already an exclusion rule defined (see PR). Maybe you can tie in here?
Solution
Provide a configuration parameter to exclude realm file from iCloud backup.
How important is this improvement for you?
I'd like to see it, but have a workaround
The text was updated successfully, but these errors were encountered: