Respond to CR.

pull/1/head
Matthew Chen 7 years ago
parent a30170b3b2
commit 4bfdef520a

@ -225,15 +225,17 @@ static NSString *const kURLHostVerifyPrefix = @"verify";
return;
}
DDLogInfo(@"%@ Database file size: %@",
self.logTag,
[OWSFileSystem fileSizeOfPath:TSStorageManager.legacyDatabaseFilePath]);
DDLogInfo(@"%@ \t SHM file size: %@",
self.logTag,
[OWSFileSystem fileSizeOfPath:TSStorageManager.legacyDatabaseFilePath_SHM]);
DDLogInfo(@"%@ \t WAL file size: %@",
self.logTag,
[OWSFileSystem fileSizeOfPath:TSStorageManager.legacyDatabaseFilePath_WAL]);
if ([NSFileManager.defaultManager fileExistsAtPath:TSStorageManager.legacyDatabaseFilePath]) {
DDLogInfo(@"%@ Database file size: %@",
self.logTag,
[OWSFileSystem fileSizeOfPath:TSStorageManager.legacyDatabaseFilePath]);
DDLogInfo(@"%@ \t SHM file size: %@",
self.logTag,
[OWSFileSystem fileSizeOfPath:TSStorageManager.legacyDatabaseFilePath_SHM]);
DDLogInfo(@"%@ \t WAL file size: %@",
self.logTag,
[OWSFileSystem fileSizeOfPath:TSStorageManager.legacyDatabaseFilePath_WAL]);
}
NSError *_Nullable error = [self convertDatabaseIfNecessary];
// TODO: Handle this error.

@ -62,7 +62,7 @@ class ContactsFrameworkContactStoreAdaptee: ContactStoreAdaptee {
@objc
func didBecomeActive() {
AppReadiness.runNowOr {
AppReadiness.runNowOrWhenAppIsReady {
let currentSortOrder = CNContactsUserDefaults.shared().sortOrder
guard currentSortOrder != self.lastSortOrder else {

@ -54,8 +54,6 @@ static NSString *const OWS104CreateRecipientIdentitiesMigrationId = @"104";
verificationState:OWSVerificationStateDefault]
saveWithTransaction:transaction];
}];
[self saveWithTransaction:transaction];
}
@end

@ -80,6 +80,7 @@ NS_ASSUME_NONNULL_BEGIN
NSUInteger totalMigrationCount = migrationsToRun.count;
__block NSUInteger completedMigrationCount = 0;
// Call the completion exactly once, when the last migration completes.
void (^checkMigrationCompletion)(void) = ^{
@synchronized(self)
{

@ -741,16 +741,7 @@ typedef NSData *_Nullable (^CreateDatabaseMetadataBlock)(void);
- (unsigned long long)databaseFileSize
{
NSFileManager *fileManager = [NSFileManager defaultManager];
NSError *_Nullable error;
unsigned long long fileSize =
[[fileManager attributesOfItemAtPath:self.databaseFilePath error:&error][NSFileSize] unsignedLongLongValue];
if (error) {
DDLogError(@"%@ Couldn't fetch database file size: %@", self.logTag, error);
} else {
DDLogInfo(@"%@ Database file size: %llu", self.logTag, fileSize);
}
return fileSize;
return [OWSFileSystem fileSizeOfPath:self.databaseFilePath].unsignedLongLongValue;
}
+ (void)storeKeyChainValue:(NSData *)data keychainKey:(NSString *)keychainKey

@ -53,7 +53,6 @@ NSString *const TSSecondaryDevicesDatabaseViewExtensionName = @"TSSecondaryDevic
+ (void)registerMessageDatabaseViewWithName:(NSString *)viewName
viewGrouping:(YapDatabaseViewGrouping *)viewGrouping
version:(NSString *)version
async:(BOOL)async
storage:(OWSStorage *)storage
{
OWSAssertIsOnMainThread();
@ -78,12 +77,7 @@ NSString *const TSSecondaryDevicesDatabaseViewExtensionName = @"TSSecondaryDevic
sorting:viewSorting
versionTag:version
options:options];
if (async) {
[storage asyncRegisterExtension:view withName:viewName];
} else {
[storage registerExtension:view withName:viewName];
}
[storage asyncRegisterExtension:view withName:viewName];
}
+ (void)asyncRegisterUnreadDatabaseView:(OWSStorage *)storage
@ -102,7 +96,6 @@ NSString *const TSSecondaryDevicesDatabaseViewExtensionName = @"TSSecondaryDevic
[self registerMessageDatabaseViewWithName:TSUnreadDatabaseViewExtensionName
viewGrouping:viewGrouping
version:@"1"
async:YES
storage:storage];
}
@ -122,7 +115,6 @@ NSString *const TSSecondaryDevicesDatabaseViewExtensionName = @"TSSecondaryDevic
[self registerMessageDatabaseViewWithName:TSUnseenDatabaseViewExtensionName
viewGrouping:viewGrouping
version:@"1"
async:YES
storage:storage];
}
@ -150,7 +142,6 @@ NSString *const TSSecondaryDevicesDatabaseViewExtensionName = @"TSSecondaryDevic
[self registerMessageDatabaseViewWithName:TSThreadSpecialMessagesDatabaseViewExtensionName
viewGrouping:viewGrouping
version:@"1"
async:YES
storage:storage];
}
@ -167,7 +158,6 @@ NSString *const TSSecondaryDevicesDatabaseViewExtensionName = @"TSSecondaryDevic
[self registerMessageDatabaseViewWithName:TSMessageDatabaseViewExtensionName
viewGrouping:viewGrouping
version:@"1"
async:YES
storage:storage];
}
@ -184,7 +174,6 @@ NSString *const TSSecondaryDevicesDatabaseViewExtensionName = @"TSSecondaryDevic
[self registerMessageDatabaseViewWithName:TSThreadOutgoingMessageDatabaseViewExtensionName
viewGrouping:viewGrouping
version:@"2"
async:YES
storage:storage];
}

@ -23,7 +23,7 @@ typedef void (^AppReadyBlock)(void);
//
// This method should only be called on the main thread.
// The block will always be called on the main thread.
+ (void)runNowOrWhenAppIsReady:(AppReadyBlock)block;
+ (void)runNowOrWhenAppIsReady:(AppReadyBlock)block NS_SWIFT_NAME(runNowOrWhenAppIsReady(_:));
@end

@ -363,9 +363,9 @@ public class ShareViewController: UINavigationController, ShareViewDelegate, SAE
Logger.debug("\(self.logTag) \(#function)")
if isReadyForAppExtensions {
AppReadiness.runNowOr(whenAppIsReady: {
AppReadiness.runNowOrWhenAppIsReady {
self.activate()
})
}
}
}

Loading…
Cancel
Save