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);
|
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
|
#pragma mark - Import / Export
|
||||||
|
|
||||||
- (void)loadRFC3339DateFormatter {
|
- (void)loadRFC3339DateFormatter {
|
||||||
|
@ -396,30 +396,32 @@
|
|||||||
|
|
||||||
#pragma mark - UbiquityStoreManagerDelegate
|
#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 {
|
- (void)ubiquityStoreManager:(UbiquityStoreManager *)manager didEncounterError:(NSError *)error cause:(UbiquityStoreManagerErrorCause)cause context:(id)context {
|
||||||
|
|
||||||
err(@"StoreManager: cause=%d, context=%@, error=%@", cause, context, error);
|
err(@"StoreManager: cause=%d, context=%@, error=%@", cause, context, error);
|
||||||
|
|
||||||
switch (cause) {
|
switch (cause) {
|
||||||
case UbiquityStoreManagerErrorCauseDeleteStore:
|
case UbiquityStoreManagerErrorCauseDeleteStore:
|
||||||
|
case UbiquityStoreManagerErrorCauseDeleteLogs:
|
||||||
case UbiquityStoreManagerErrorCauseCreateStorePath:
|
case UbiquityStoreManagerErrorCauseCreateStorePath:
|
||||||
case UbiquityStoreManagerErrorCauseClearStore:
|
case UbiquityStoreManagerErrorCauseClearStore:
|
||||||
break;
|
break;
|
||||||
case UbiquityStoreManagerErrorCauseOpenLocalStore: {
|
case UbiquityStoreManagerErrorCauseOpenLocalStore: {
|
||||||
[PearlAlert showError:@"Could not open your local database.\n\n"
|
wrn(@"Local store could not be opened, resetting it.");
|
||||||
@"The database may be too old. It will be deleted, the application will quit, "
|
manager.hardResetEnabled = YES;
|
||||||
@"and on the next launch a fresh database will be created." tappedButtonBlock:^(UIAlertView *alert, NSInteger buttonIndex) {
|
[manager hardResetLocalStorage];
|
||||||
wrn(@"Local store could not be opened, deleting it.");
|
exit(1);
|
||||||
[[NSFileManager defaultManager] removeItemAtURL:context error:nil];
|
|
||||||
exit(0);
|
|
||||||
} otherTitles:nil];
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case UbiquityStoreManagerErrorCauseOpenCloudStore: {
|
case UbiquityStoreManagerErrorCauseOpenCloudStore: {
|
||||||
[PearlAlert showError:@"Could not use iCloud-synced storage. Will use a local database for now.\n\n"
|
wrn(@"iCloud store could not be opened, resetting it.");
|
||||||
@"If this problem persists, you may need to reset your Master Password database on iCloud."];
|
manager.hardResetEnabled = YES;
|
||||||
wrn(@"iCloud store could not be opened, moving to local store.");
|
[manager hardResetCloudStorage];
|
||||||
[manager useiCloudStore:NO alertUser:NO];
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user