Lazy restore attachments.

pull/1/head
Matthew Chen 6 years ago
parent cb8ee3536a
commit 8254052bb2

@ -12,9 +12,6 @@ import CloudKit
// Note that all of our CloudKit records are immutable.
// "Persistent" records are only uploaded once.
// "Ephemeral" records are always uploaded to a new record name.
//
// TODO: We could store known encryption ids locally to
// facilitate "resume" of failed backup exports.
@objc public class OWSBackupAPI: NSObject {
// If we change the record types, we need to ensure indices

@ -219,7 +219,7 @@ NSString *const kOWSBackup_ImportDatabaseKeySpec = @"kOWSBackup_ImportDatabaseKe
@"Indicates that the backup import data is being downloaded.")
progress:@(progress)];
// Use a predictable file path so that multiple "import backup" attempts
// 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.
@ -287,7 +287,7 @@ NSString *const kOWSBackup_ImportDatabaseKeySpec = @"kOWSBackup_ImportDatabaseKe
// Attachment-related errors are recoverable and can be ignored.
continue;
}
[attachment updateWithLazyRestoreFragment:item transaction:transaction];
[attachment markForLazyRestoreWithFragment:item transaction:transaction];
count++;
[self updateProgressWithDescription:NSLocalizedString(@"BACKUP_IMPORT_PHASE_RESTORING_FILES",
@"Indicates that the backup import data is being restored.")

@ -69,8 +69,8 @@ NS_ASSUME_NONNULL_BEGIN
#pragma mark - Update With... Methods
// Marks attachment as needing "lazy backup restore."
- (void)updateWithLazyRestoreFragment:(OWSBackupFragment *)lazyRestoreFragment
transaction:(YapDatabaseReadWriteTransaction *)transaction;
- (void)markForLazyRestoreWithFragment:(OWSBackupFragment *)lazyRestoreFragment
transaction:(YapDatabaseReadWriteTransaction *)transaction;
// Marks attachment as having completed "lazy backup restore."
- (void)updateWithLazyRestoreComplete;

@ -623,8 +623,8 @@ NS_ASSUME_NONNULL_BEGIN
#pragma mark - Update With... Methods
- (void)updateWithLazyRestoreFragment:(OWSBackupFragment *)lazyRestoreFragment
transaction:(YapDatabaseReadWriteTransaction *)transaction
- (void)markForLazyRestoreWithFragment:(OWSBackupFragment *)lazyRestoreFragment
transaction:(YapDatabaseReadWriteTransaction *)transaction
{
OWSAssert(lazyRestoreFragment);
OWSAssert(transaction);

Loading…
Cancel
Save