Fix migration problems non-interactively.
[FIXED] Migration problems should be fixed non-interactively: The main thread may well be unavailable which means we may not be able to actually get a message through to the user. This would dead-lock the migration problem recovery.
This commit is contained in:
parent
c8f9f79bb2
commit
db7d68a091
2
External/iCloudStoreManager
vendored
2
External/iCloudStoreManager
vendored
@ -1 +1 @@
|
||||
Subproject commit b456a34975e65fba8e2228b790706d852188ecb2
|
||||
Subproject commit 71cfb8f4e21a536f5d88a69401f02eeaf1c0a89f
|
@ -181,11 +181,6 @@ static NSDateFormatter *rfc3339DateFormatter = nil;
|
||||
dbg(@"StoreManager: %@", message);
|
||||
}
|
||||
|
||||
- (void)ubiquityStoreManager:(UbiquityStoreManager *)manager didEncounterError:(NSError *)error cause:(UbiquityStoreManagerErrorCause)cause context:(id)context {
|
||||
|
||||
err(@"StoreManager: cause=%d, context=%@, error=%@", cause, context, error);
|
||||
}
|
||||
|
||||
#pragma mark - Import / Export
|
||||
|
||||
- (void)loadRFC3339DateFormatter {
|
||||
|
@ -396,30 +396,32 @@
|
||||
|
||||
#pragma mark - UbiquityStoreManagerDelegate
|
||||
|
||||
- (void)ubiquityStoreManager:(UbiquityStoreManager *)manager didSwitchToiCloud:(BOOL)didSwitch {
|
||||
|
||||
inf(@"didSwitchToiCloud: %d", didSwitch);
|
||||
}
|
||||
|
||||
- (void)ubiquityStoreManager:(UbiquityStoreManager *)manager didEncounterError:(NSError *)error cause:(UbiquityStoreManagerErrorCause)cause context:(id)context {
|
||||
|
||||
err(@"StoreManager: cause=%d, context=%@, error=%@", cause, context, error);
|
||||
|
||||
switch (cause) {
|
||||
case UbiquityStoreManagerErrorCauseDeleteStore:
|
||||
case UbiquityStoreManagerErrorCauseDeleteLogs:
|
||||
case UbiquityStoreManagerErrorCauseCreateStorePath:
|
||||
case UbiquityStoreManagerErrorCauseClearStore:
|
||||
break;
|
||||
case UbiquityStoreManagerErrorCauseOpenLocalStore: {
|
||||
[PearlAlert showError:@"Could not open your local database.\n\n"
|
||||
@"The database may be too old. It will be deleted, the application will quit, "
|
||||
@"and on the next launch a fresh database will be created." tappedButtonBlock:^(UIAlertView *alert, NSInteger buttonIndex) {
|
||||
wrn(@"Local store could not be opened, deleting it.");
|
||||
[[NSFileManager defaultManager] removeItemAtURL:context error:nil];
|
||||
exit(0);
|
||||
} otherTitles:nil];
|
||||
wrn(@"Local store could not be opened, resetting it.");
|
||||
manager.hardResetEnabled = YES;
|
||||
[manager hardResetLocalStorage];
|
||||
exit(1);
|
||||
break;
|
||||
}
|
||||
case UbiquityStoreManagerErrorCauseOpenCloudStore: {
|
||||
[PearlAlert showError:@"Could not use iCloud-synced storage. Will use a local database for now.\n\n"
|
||||
@"If this problem persists, you may need to reset your Master Password database on iCloud."];
|
||||
wrn(@"iCloud store could not be opened, moving to local store.");
|
||||
[manager useiCloudStore:NO alertUser:NO];
|
||||
wrn(@"iCloud store could not be opened, resetting it.");
|
||||
manager.hardResetEnabled = YES;
|
||||
[manager hardResetCloudStorage];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user