-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Update NSFileProtection samples to set attributes on lock files #1571
Comments
I tried to compare behaviour with https://github.com/marcoarment/FCModel and FCModel works fine even in background locked mode. |
What sort of error are you seeing when realm crashes? It'd be really helpful if you could share a stack trace! |
failed to open(). something related with permissions... |
It seems like NSFileProtectionKey:NSFileProtectionNone needs to be applied to db log file or something else you guys use in addition to main db file. |
Hi @kronik, you're right that you'll have to set the NSString *pathToRealmFile = [RLMRealm defaultRealmPath];
NSArray *allRealmRelatedFiles = @[
pathToRealmFile,
[pathToRealmFile stringByAppendingPathExtension:@"lock"],
[pathToRealmFile stringByAppendingPathExtension:@"log"],
[pathToRealmFile stringByAppendingPathExtension:@"log_a"],
[pathToRealmFile stringByAppendingPathExtension:@"log_b"]
];
for (NSString *path in allRealmRelatedFiles) {
NSError *error = nil;
[[NSFileManager defaultManager] setAttributes:@{NSFileProtectionKey: NSFileProtectionNone}
ofItemAtPath:path
error:&error];
} We'll be updating our |
That's what we'll do in the short term. However users really shouldn't have to know about all these potential ancillary files so we'll be adding a convenience method like |
Lets just do #1584 rather than adding a new global configuration method that we will remove soon after adding. |
Similarly, do I need to delete all these five files explicitly if I want to delete a Realm? |
If you're just deleting and recreating the Realm file, then no (barring bugs in Realm). |
If not, will it take more disk space? |
This is now documented in https://realm.io/docs/objc/latest/#encryption. |
This issue is very similar to #1260 .
Application tries to select data from Realm db when app fetch in background handler is called.
And I
disabled protection at all:
tried also with NSFileProtectionCompleteUntilFirstUserAuthentication but still the same.
What I'm doing wrong?
The text was updated successfully, but these errors were encountered: