session-ios/Signal/src/util/Backup/OWSBackupImportJob.m

575 lines
21 KiB
Mathematica
Raw Normal View History

2018-03-08 19:38:42 +01:00
//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
#import "OWSBackupImportJob.h"
#import "OWSBackupIO.h"
2018-03-13 13:44:49 +01:00
#import "OWSDatabaseMigration.h"
#import "OWSDatabaseMigrationRunner.h"
2018-03-08 19:38:42 +01:00
#import "Signal-Swift.h"
2018-11-27 17:15:09 +01:00
#import <PromiseKit/AnyPromise.h>
2018-09-21 21:41:10 +02:00
#import <SignalCoreKit/NSData+OWS.h>
2018-03-08 19:38:42 +01:00
#import <SignalServiceKit/OWSBackgroundTask.h>
#import <SignalServiceKit/OWSFileSystem.h>
2018-03-12 20:28:55 +01:00
#import <SignalServiceKit/TSAttachment.h>
2018-03-08 19:38:42 +01:00
#import <SignalServiceKit/TSMessage.h>
#import <SignalServiceKit/TSThread.h>
NS_ASSUME_NONNULL_BEGIN
NSString *const kOWSBackup_ImportDatabaseKeySpec = @"kOWSBackup_ImportDatabaseKeySpec";
#pragma mark -
@interface OWSBackupImportJob ()
@property (nonatomic, nullable) OWSBackgroundTask *backgroundTask;
2018-03-08 19:38:42 +01:00
@property (nonatomic) OWSBackupIO *backupIO;
2018-03-08 20:02:39 +01:00
2018-11-28 18:55:01 +01:00
@property (nonatomic) OWSBackupManifestContents *manifest;
2018-03-08 20:02:39 +01:00
2018-03-08 19:38:42 +01:00
@end
#pragma mark -
@implementation OWSBackupImportJob
#pragma mark - Dependencies
- (OWSPrimaryStorage *)primaryStorage
{
OWSAssertDebug(SSKEnvironment.shared.primaryStorage);
return SSKEnvironment.shared.primaryStorage;
}
2018-11-28 16:02:48 +01:00
- (OWSProfileManager *)profileManager
{
return [OWSProfileManager sharedManager];
}
- (TSAccountManager *)tsAccountManager
{
OWSAssertDebug(SSKEnvironment.shared.tsAccountManager);
return SSKEnvironment.shared.tsAccountManager;
}
2018-11-27 17:33:31 +01:00
- (OWSBackup *)backup
{
OWSAssertDebug(AppEnvironment.shared.backup);
return AppEnvironment.shared.backup;
}
2018-11-29 18:09:18 +01:00
- (OWSBackupLazyRestore *)backupLazyRestore
{
return AppEnvironment.shared.backupLazyRestore;
}
#pragma mark -
2018-11-28 18:55:01 +01:00
- (NSArray<OWSBackupFragment *> *)databaseItems
{
OWSAssertDebug(self.manifest);
return self.manifest.databaseItems;
}
- (NSArray<OWSBackupFragment *> *)attachmentsItems
{
OWSAssertDebug(self.manifest);
return self.manifest.attachmentsItems;
}
2018-11-29 16:32:27 +01:00
- (void)start
2018-03-08 19:38:42 +01:00
{
OWSAssertIsOnMainThread();
OWSLogInfo(@"");
2018-03-08 19:38:42 +01:00
self.backgroundTask = [OWSBackgroundTask backgroundTaskWithLabelStr:__PRETTY_FUNCTION__];
[self updateProgressWithDescription:nil progress:nil];
2018-11-28 23:01:26 +01:00
[[self.backup ensureCloudKitAccess]
2018-11-27 17:49:30 +01:00
.thenInBackground(^{
2018-11-29 16:32:27 +01:00
[self updateProgressWithDescription:NSLocalizedString(@"BACKUP_IMPORT_PHASE_CONFIGURATION",
@"Indicates that the backup import is being configured.")
progress:nil];
2018-03-08 19:38:42 +01:00
2018-11-29 16:32:27 +01:00
return [self configureImport];
})
.thenInBackground(^{
if (self.isComplete) {
return
[AnyPromise promiseWithValue:OWSBackupErrorWithDescription(@"Backup import no longer active.")];
}
2018-03-12 20:28:55 +01:00
2018-11-29 16:32:27 +01:00
[self updateProgressWithDescription:NSLocalizedString(@"BACKUP_IMPORT_PHASE_IMPORT",
@"Indicates that the backup import data is being imported.")
progress:nil];
2018-03-12 20:28:55 +01:00
2018-11-29 16:32:27 +01:00
return [self downloadAndProcessManifestWithBackupIO:self.backupIO];
})
2018-11-28 21:49:45 +01:00
.thenInBackground(^(OWSBackupManifestContents *manifest) {
OWSCAssertDebug(manifest.databaseItems.count > 0);
OWSCAssertDebug(manifest.attachmentsItems);
self.manifest = manifest;
return [self downloadAndProcessImport];
})
2018-11-29 16:32:27 +01:00
.catch(^(NSError *error) {
[self failWithErrorDescription:
NSLocalizedString(@"BACKUP_IMPORT_ERROR_COULD_NOT_IMPORT",
@"Error indicating the backup import could not import the user's data.")];
2018-11-28 21:49:45 +01:00
}) retainUntilComplete];
}
2018-03-12 20:10:37 +01:00
2018-11-28 21:49:45 +01:00
- (AnyPromise *)downloadAndProcessImport
{
OWSAssertDebug(self.databaseItems);
OWSAssertDebug(self.attachmentsItems);
2018-03-12 20:28:55 +01:00
NSMutableArray<OWSBackupFragment *> *allItems = [NSMutableArray new];
[allItems addObjectsFromArray:self.databaseItems];
2018-11-28 21:57:41 +01:00
// TODO: We probably want to remove this.
[allItems addObjectsFromArray:self.attachmentsItems];
2018-11-28 21:49:45 +01:00
if (self.manifest.localProfileAvatarItem) {
[allItems addObject:self.manifest.localProfileAvatarItem];
}
// Record metadata for all items, so that we can re-use them in incremental backups after the restore.
[self.primaryStorage.newDatabaseConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
for (OWSBackupFragment *item in allItems) {
[item saveWithTransaction:transaction];
}
}];
2018-11-28 21:49:45 +01:00
return [self downloadFilesFromCloud:allItems]
.thenInBackground(^{
return [self restoreDatabase];
})
.thenInBackground(^{
return [self ensureMigrations];
})
.thenInBackground(^{
return [self restoreLocalProfile];
})
.thenInBackground(^{
return [self restoreAttachmentFiles];
})
2018-11-29 18:09:18 +01:00
.then(^{
// Kick off lazy restore on main thread.
[self.backupLazyRestore runIfNecessary];
})
2018-11-28 21:49:45 +01:00
.thenInBackground(^{
[self.profileManager fetchLocalUsersProfile];
[self.tsAccountManager updateAccountAttributes];
2018-11-29 15:25:56 +01:00
// Make sure backup is enabled once we complete
// a backup restore.
[OWSBackup.sharedManager setIsBackupEnabled:YES];
2018-11-28 21:49:45 +01:00
[self succeed];
});
2018-03-08 19:38:42 +01:00
}
2018-11-29 16:32:27 +01:00
- (AnyPromise *)configureImport
2018-03-08 19:38:42 +01:00
{
OWSLogVerbose(@"");
2018-03-08 19:38:42 +01:00
if (![self ensureJobTempDir]) {
OWSFailDebug(@"Could not create jobTempDirPath.");
2018-11-29 16:32:27 +01:00
return [AnyPromise promiseWithValue:OWSBackupErrorWithDescription(@"Could not create jobTempDirPath.")];
2018-03-08 19:38:42 +01:00
}
self.backupIO = [[OWSBackupIO alloc] initWithJobTempDirPath:self.jobTempDirPath];
2018-11-29 16:32:27 +01:00
return [AnyPromise promiseWithValue:@(1)];
2018-03-08 19:38:42 +01:00
}
2018-11-28 21:49:45 +01:00
- (AnyPromise *)downloadFilesFromCloud:(NSMutableArray<OWSBackupFragment *> *)items
2018-03-08 20:02:39 +01:00
{
OWSAssertDebug(items.count > 0);
2018-03-08 20:02:39 +01:00
OWSLogVerbose(@"");
2018-03-08 20:02:39 +01:00
2018-11-28 21:49:45 +01:00
NSUInteger recordCount = items.count;
2018-03-08 20:02:39 +01:00
2018-03-12 20:10:37 +01:00
if (self.isComplete) {
// Job was aborted.
2018-11-28 21:49:45 +01:00
return [AnyPromise promiseWithValue:OWSBackupErrorWithDescription(@"Backup import no longer active.")];
2018-03-12 20:10:37 +01:00
}
if (items.count < 1) {
2018-03-08 20:02:39 +01:00
// All downloads are complete; exit.
2018-11-28 21:49:45 +01:00
return [AnyPromise promiseWithValue:@(1)];
2018-03-08 20:02:39 +01:00
}
2018-11-28 21:49:45 +01:00
AnyPromise *promise = [AnyPromise promiseWithValue:@(1)];
for (OWSBackupFragment *item in items) {
promise = promise.thenInBackground(^{
CGFloat progress = (recordCount > 0 ? ((recordCount - items.count) / (CGFloat)recordCount) : 0.f);
[self updateProgressWithDescription:NSLocalizedString(@"BACKUP_IMPORT_PHASE_DOWNLOAD",
@"Indicates that the backup import data is being downloaded.")
progress:@(progress)];
});
2018-03-12 20:10:37 +01:00
2018-11-28 21:49:45 +01:00
// TODO: Use a predictable file path so that multiple "import backup" attempts
// will leverage successful file downloads from previous attempts.
//
// TODO: This will also require imports using a predictable jobTempDirPath.
NSString *tempFilePath = [self.jobTempDirPath stringByAppendingPathComponent:item.recordName];
2018-11-28 21:49:45 +01:00
// Skip redundant file download.
if ([NSFileManager.defaultManager fileExistsAtPath:tempFilePath]) {
[OWSFileSystem protectFileOrFolderAtPath:tempFilePath];
2018-11-28 21:49:45 +01:00
item.downloadFilePath = tempFilePath;
continue;
}
promise = promise.thenInBackground(^{
return [OWSBackupAPI downloadFileFromCloudObjcWithRecordName:item.recordName
toFileUrl:[NSURL fileURLWithPath:tempFilePath]]
.thenInBackground(^{
[OWSFileSystem protectFileOrFolderAtPath:tempFilePath];
item.downloadFilePath = tempFilePath;
});
});
2018-03-12 20:10:37 +01:00
}
2018-03-08 20:02:39 +01:00
2018-11-28 21:49:45 +01:00
return promise;
}
- (AnyPromise *)restoreLocalProfile
{
OWSLogVerbose(@": %zd", self.attachmentsItems.count);
2018-11-28 21:49:45 +01:00
if (self.isComplete) {
// Job was aborted.
return [AnyPromise promiseWithValue:OWSBackupErrorWithDescription(@"Backup import no longer active.")];
}
NSString *_Nullable localProfileName = self.manifest.localProfileName;
UIImage *_Nullable localProfileAvatar = nil;
if (self.manifest.localProfileAvatarItem) {
OWSBackupFragment *item = self.manifest.localProfileAvatarItem;
if (item.recordName.length < 1) {
OWSLogError(@"local profile avatar was not downloaded.");
// Ignore errors related to local profile.
return [AnyPromise promiseWithValue:@(1)];
}
if (!item.uncompressedDataLength || item.uncompressedDataLength.unsignedIntValue < 1) {
OWSLogError(@"database snapshot missing size.");
// Ignore errors related to local profile.
return [AnyPromise promiseWithValue:@(1)];
}
@autoreleasepool {
NSData *_Nullable data =
[self.backupIO decryptFileAsData:item.downloadFilePath encryptionKey:item.encryptionKey];
if (!data) {
OWSLogError(@"could not decrypt local profile avatar.");
// Ignore errors related to local profile.
return [AnyPromise promiseWithValue:@(1)];
}
// TODO: Verify that we're not compressing the profile avatar data.
UIImage *_Nullable image = [UIImage imageWithData:data];
if (!image) {
OWSLogError(@"could not decrypt local profile avatar.");
// Ignore errors related to local profile.
return [AnyPromise promiseWithValue:@(1)];
}
localProfileAvatar = image;
2018-03-08 20:02:39 +01:00
}
2018-11-28 21:49:45 +01:00
}
if (localProfileName.length > 0 || localProfileAvatar) {
AnyPromise *promise = [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) {
[self.profileManager updateLocalProfileName:localProfileName
avatarImage:localProfileAvatar
success:^{
resolve(@(1));
}
failure:^{
// Ignore errors related to local profile.
resolve(@(1));
}];
2018-03-08 20:02:39 +01:00
}];
2018-11-28 21:49:45 +01:00
return promise;
} else {
return [AnyPromise promiseWithValue:@(1)];
}
2018-03-08 20:02:39 +01:00
}
2018-11-28 21:49:45 +01:00
- (AnyPromise *)restoreAttachmentFiles
2018-03-12 20:10:37 +01:00
{
OWSLogVerbose(@": %zd", self.attachmentsItems.count);
2018-03-12 20:10:37 +01:00
2018-11-28 21:49:45 +01:00
if (self.isComplete) {
// Job was aborted.
return [AnyPromise promiseWithValue:OWSBackupErrorWithDescription(@"Backup import no longer active.")];
}
2018-03-22 18:33:34 +01:00
__block NSUInteger count = 0;
2018-03-22 19:05:12 +01:00
YapDatabaseConnection *dbConnection = self.primaryStorage.newDatabaseConnection;
[dbConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
2018-03-22 18:33:34 +01:00
for (OWSBackupFragment *item in self.attachmentsItems) {
if (self.isComplete) {
return;
}
if (item.recordName.length < 1) {
OWSLogError(@"attachment was not downloaded.");
2018-03-22 18:33:34 +01:00
// Attachment-related errors are recoverable and can be ignored.
2018-03-22 14:32:22 +01:00
continue;
}
2018-03-22 18:33:34 +01:00
if (item.attachmentId.length < 1) {
OWSLogError(@"attachment missing attachment id.");
2018-03-22 18:33:34 +01:00
// Attachment-related errors are recoverable and can be ignored.
continue;
}
if (item.relativeFilePath.length < 1) {
OWSLogError(@"attachment missing relative file path.");
// Attachment-related errors are recoverable and can be ignored.
continue;
}
TSAttachmentPointer *_Nullable attachment =
[TSAttachmentPointer fetchObjectWithUniqueID:item.attachmentId transaction:transaction];
2018-03-22 18:33:34 +01:00
if (!attachment) {
OWSLogError(@"attachment to restore could not be found.");
2018-03-22 18:33:34 +01:00
// Attachment-related errors are recoverable and can be ignored.
continue;
}
if (![attachment isKindOfClass:[TSAttachmentPointer class]]) {
OWSFailDebug(@"attachment has unexpected type: %@.", attachment.class);
// Attachment-related errors are recoverable and can be ignored.
continue;
}
2018-03-22 19:12:29 +01:00
[attachment markForLazyRestoreWithFragment:item transaction:transaction];
2018-03-22 18:33:34 +01:00
count++;
[self updateProgressWithDescription:NSLocalizedString(@"BACKUP_IMPORT_PHASE_RESTORING_FILES",
@"Indicates that the backup import data is being restored.")
progress:@(count / (CGFloat)self.attachmentsItems.count)];
2018-03-12 20:10:37 +01:00
}
2018-03-22 18:33:34 +01:00
}];
2018-03-12 20:10:37 +01:00
OWSLogError(@"enqueued lazy restore of %zd files.", count);
2018-11-28 21:49:45 +01:00
return [AnyPromise promiseWithValue:@(1)];
2018-03-08 20:02:39 +01:00
}
2018-11-28 21:49:45 +01:00
- (AnyPromise *)restoreDatabase
2018-03-12 20:10:37 +01:00
{
OWSLogVerbose(@"");
2018-03-12 20:10:37 +01:00
if (self.isComplete) {
2018-11-28 21:49:45 +01:00
// Job was aborted.
return [AnyPromise promiseWithValue:OWSBackupErrorWithDescription(@"Backup import no longer active.")];
2018-03-12 20:10:37 +01:00
}
YapDatabaseConnection *_Nullable dbConnection = self.primaryStorage.newDatabaseConnection;
if (!dbConnection) {
OWSFailDebug(@"Could not create dbConnection.");
2018-11-28 21:49:45 +01:00
return [AnyPromise promiseWithValue:OWSBackupErrorWithDescription(@"Could not create dbConnection.")];
2018-03-12 20:10:37 +01:00
}
2018-03-13 14:51:57 +01:00
// Order matters here.
NSArray<NSString *> *collectionsToRestore = @[
[TSThread collection],
[TSAttachment collection],
// Interactions refer to threads and attachments,
// so copy them afterward.
[TSInteraction collection],
[OWSDatabaseMigration collection],
];
NSMutableDictionary<NSString *, NSNumber *> *restoredEntityCounts = [NSMutableDictionary new];
2018-03-12 20:10:37 +01:00
__block unsigned long long copiedEntities = 0;
2018-03-13 14:51:57 +01:00
__block BOOL aborted = NO;
[dbConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
for (NSString *collection in collectionsToRestore) {
if ([collection isEqualToString:[OWSDatabaseMigration collection]]) {
// It's okay if there are existing migrations; we'll clear those
// before restoring.
continue;
}
if ([transaction numberOfKeysInCollection:collection] > 0) {
OWSLogError(@"unexpected contents in database (%@).", collection);
}
}
// Clear existing database contents.
//
// This should be safe since we only ever import into an empty database.
//
// Note that if the app receives a message after registering and before restoring
// backup, it will be lost.
//
// Note that this will clear all migrations.
for (NSString *collection in collectionsToRestore) {
[transaction removeAllObjectsInCollection:collection];
}
NSUInteger count = 0;
for (OWSBackupFragment *item in self.databaseItems) {
if (self.isComplete) {
return;
}
if (item.recordName.length < 1) {
OWSLogError(@"database snapshot was not downloaded.");
// Attachment-related errors are recoverable and can be ignored.
// Database-related errors are unrecoverable.
2018-03-13 16:30:38 +01:00
aborted = YES;
2018-11-28 21:49:45 +01:00
return;
2018-03-13 16:30:38 +01:00
}
if (!item.uncompressedDataLength || item.uncompressedDataLength.unsignedIntValue < 1) {
OWSLogError(@"database snapshot missing size.");
// Attachment-related errors are recoverable and can be ignored.
// Database-related errors are unrecoverable.
aborted = YES;
2018-11-28 21:49:45 +01:00
return;
2018-03-13 14:51:57 +01:00
}
2018-03-13 13:44:49 +01:00
count++;
[self updateProgressWithDescription:NSLocalizedString(@"BACKUP_IMPORT_PHASE_RESTORING_DATABASE",
@"Indicates that the backup database is being restored.")
progress:@(count / (CGFloat)self.databaseItems.count)];
@autoreleasepool {
NSData *_Nullable compressedData =
[self.backupIO decryptFileAsData:item.downloadFilePath encryptionKey:item.encryptionKey];
if (!compressedData) {
// Database-related errors are unrecoverable.
aborted = YES;
2018-11-28 21:49:45 +01:00
return;
}
NSData *_Nullable uncompressedData =
[self.backupIO decompressData:compressedData
uncompressedDataLength:item.uncompressedDataLength.unsignedIntValue];
if (!uncompressedData) {
// Database-related errors are unrecoverable.
aborted = YES;
2018-11-28 21:49:45 +01:00
return;
}
2018-08-07 20:36:36 +02:00
NSError *error;
SignalIOSProtoBackupSnapshot *_Nullable entities =
[SignalIOSProtoBackupSnapshot parseData:uncompressedData error:&error];
if (!entities || error) {
OWSLogError(@"could not parse proto: %@.", error);
2018-08-07 20:36:36 +02:00
// Database-related errors are unrecoverable.
2018-08-06 16:05:21 +02:00
aborted = YES;
2018-11-28 21:49:45 +01:00
return;
2018-04-16 20:48:29 +02:00
}
if (!entities || entities.entity.count < 1) {
OWSLogError(@"missing entities.");
// Database-related errors are unrecoverable.
aborted = YES;
2018-11-28 21:49:45 +01:00
return;
}
2018-08-06 16:05:21 +02:00
for (SignalIOSProtoBackupSnapshotBackupEntity *entity in entities.entity) {
NSData *_Nullable entityData = entity.entityData;
if (entityData.length < 1) {
OWSLogError(@"missing entity data.");
// Database-related errors are unrecoverable.
aborted = YES;
2018-11-28 21:49:45 +01:00
return;
}
2018-03-13 13:44:49 +01:00
2018-11-28 15:32:12 +01:00
NSString *_Nullable collection = entity.collection;
if (collection.length < 1) {
OWSLogError(@"missing collection.");
// Database-related errors are unrecoverable.
aborted = YES;
2018-11-28 21:49:45 +01:00
return;
2018-11-28 15:32:12 +01:00
}
NSString *_Nullable key = entity.key;
if (key.length < 1) {
OWSLogError(@"missing key.");
// Database-related errors are unrecoverable.
aborted = YES;
2018-11-28 21:49:45 +01:00
return;
2018-11-28 15:32:12 +01:00
}
__block NSObject *object = nil;
@try {
NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:entityData];
object = [unarchiver decodeObjectForKey:@"root"];
if (![object isKindOfClass:[object class]]) {
OWSLogError(@"invalid decoded entity: %@.", [object class]);
// Database-related errors are unrecoverable.
aborted = YES;
2018-11-28 21:49:45 +01:00
return;
}
} @catch (NSException *exception) {
OWSLogError(@"could not decode entity.");
// Database-related errors are unrecoverable.
aborted = YES;
2018-11-28 21:49:45 +01:00
return;
}
2018-11-28 15:32:12 +01:00
[transaction setObject:object forKey:key inCollection:collection];
copiedEntities++;
NSUInteger restoredEntityCount = restoredEntityCounts[collection].unsignedIntValue;
restoredEntityCounts[collection] = @(restoredEntityCount + 1);
}
2018-03-13 14:51:57 +01:00
}
}
2018-03-12 20:10:37 +01:00
}];
2018-11-28 21:49:45 +01:00
if (aborted) {
return [AnyPromise promiseWithValue:OWSBackupErrorWithDescription(@"Backup import failed.")];
}
if (self.isComplete) {
// Job was aborted.
return [AnyPromise promiseWithValue:OWSBackupErrorWithDescription(@"Backup import no longer active.")];
2018-03-13 14:51:57 +01:00
}
for (NSString *collection in restoredEntityCounts) {
OWSLogInfo(@"copied %@: %@", collection, restoredEntityCounts[collection]);
2018-03-13 14:51:57 +01:00
}
OWSLogInfo(@"copiedEntities: %llu", copiedEntities);
2018-03-12 20:10:37 +01:00
[self.primaryStorage logFileSizes];
2018-03-12 20:10:37 +01:00
2018-11-28 21:49:45 +01:00
return [AnyPromise promiseWithValue:@(1)];
2018-03-12 20:10:37 +01:00
}
2018-11-28 21:49:45 +01:00
- (AnyPromise *)ensureMigrations
2018-03-13 13:44:49 +01:00
{
OWSLogVerbose(@"");
2018-03-13 13:44:49 +01:00
2018-11-28 21:49:45 +01:00
if (self.isComplete) {
// Job was aborted.
return [AnyPromise promiseWithValue:OWSBackupErrorWithDescription(@"Backup import no longer active.")];
}
2018-03-13 17:01:44 +01:00
[self updateProgressWithDescription:NSLocalizedString(@"BACKUP_IMPORT_PHASE_FINALIZING",
@"Indicates that the backup import data is being finalized.")
progress:nil];
2018-03-13 14:51:57 +01:00
// It's okay that we do this in a separate transaction from the
// restoration of backup contents. If some of migrations don't
// complete, they'll be run the next time the app launches.
2018-11-28 21:49:45 +01:00
AnyPromise *promise = [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) {
dispatch_async(dispatch_get_main_queue(), ^{
[[[OWSDatabaseMigrationRunner alloc] init] runAllOutstandingWithCompletion:^{
resolve(@(1));
}];
});
}];
return promise;
2018-03-13 13:44:49 +01:00
}
2018-03-08 19:38:42 +01:00
@end
NS_ASSUME_NONNULL_END