Revert "Add logging around 'share from SAE to same conversation' crash."

This reverts commit f62bf7d18e.
pull/1/head
Matthew Chen 7 years ago
parent 87d51aaa82
commit e3378dec65

@ -458,7 +458,6 @@ typedef enum : NSUInteger {
[[OWSPrimaryStorage sharedManager] updateUIDatabaseConnectionToLatest];
[self createNewMessageMappings];
DDLogInfo(@"%@ reload view items in configureForThread.", self.logTag);
if (![self reloadViewItems]) {
OWSFail(@"%@ failed to reload view items in configureForThread.", self.logTag);
}
@ -799,7 +798,6 @@ typedef enum : NSUInteger {
// Avoid layout corrupt issues and out-of-date message subtitles.
self.lastReloadDate = [NSDate new];
self.collapseCutoffDate = [NSDate new];
DDLogInfo(@"%@ reload view items in resetContentAndLayout.", self.logTag);
if (![self reloadViewItems]) {
OWSFail(@"%@ failed to reload view items in resetContentAndLayout.", self.logTag);
}
@ -3229,10 +3227,7 @@ typedef enum : NSUInteger {
OWSAssertIsOnMainThread();
// DDLogVerbose(@"%@ %s", self.logTag, __PRETTY_FUNCTION__);
DDLogInfo(@"%@ uiDatabaseDidUpdateExternally: %zd, %d",
self.logTag,
self.viewItems.count,
self.shouldObserveDBModifications);
DDLogInfo(@"%@ uiDatabaseDidUpdateExternally: %zd", self.logTag, self.viewItems.count);
if (self.shouldObserveDBModifications) {
// External database modifications can't be converted into incremental updates,
@ -3265,11 +3260,6 @@ typedef enum : NSUInteger {
{
OWSAssertIsOnMainThread();
DDLogInfo(@"%@ uiDatabaseDidUpdate, connection snapshot: %llu, mappings snapshot: %llu.",
self.logTag,
self.uiDatabaseConnection.snapshot,
self.messageMappings.snapshotOfLastUpdate);
if (!self.shouldObserveDBModifications) {
DDLogInfo(@"%@ uiDatabaseDidUpdate (ignoring): %zd", self.logTag, self.viewItems.count);
@ -3386,7 +3376,6 @@ typedef enum : NSUInteger {
}
NSUInteger oldViewItemCount = self.viewItems.count;
DDLogInfo(@"%@ reload view items in uiDatabaseDidUpdate.", self.logTag);
if (![self reloadViewItems]) {
// These errors are rare.
OWSFail(@"%@ could not reload view items; hard resetting message mappings.", self.logTag);
@ -4622,12 +4611,6 @@ typedef enum : NSUInteger {
return;
}
DDLogInfo(@"%@ in %s, %d -> %d",
self.logTag,
__PRETTY_FUNCTION__,
_shouldObserveDBModifications,
shouldObserveDBModifications);
_shouldObserveDBModifications = shouldObserveDBModifications;
if (self.shouldObserveDBModifications) {
@ -4897,11 +4880,6 @@ typedef enum : NSUInteger {
// Returns NO on error.
- (BOOL)reloadViewItems
{
DDLogInfo(@"%@ reloadViewItems, connection snapshot: %llu, mappings snapshot: %llu.",
self.logTag,
self.uiDatabaseConnection.snapshot,
self.messageMappings.snapshotOfLastUpdate);
NSMutableArray<ConversationViewItem *> *viewItems = [NSMutableArray new];
NSMutableDictionary<NSString *, ConversationViewItem *> *viewItemCache = [NSMutableDictionary new];

@ -90,9 +90,6 @@ void VerifyRegistrationsForPrimaryStorage(OWSStorage *storage)
// Increase object cache limit. Default is 250.
_uiDatabaseConnection.objectCacheLimit = 500;
[_uiDatabaseConnection beginLongLivedReadTransaction];
((OWSDatabaseConnection *)_uiDatabaseConnection).isReadOnly = YES;
((OWSDatabaseConnection *)_uiDatabaseConnection).shouldLogLongLived = YES;
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(yapDatabaseModified:)
name:YapDatabaseModifiedNotification
@ -137,8 +134,6 @@ void VerifyRegistrationsForPrimaryStorage(OWSStorage *storage)
{
OWSAssertIsOnMainThread();
DDLogInfo(@"%@ %s", self.logTag, __PRETTY_FUNCTION__);
// Notify observers we're about to update the database connection
[[NSNotificationCenter defaultCenter] postNotificationName:OWSUIDatabaseConnectionWillUpdateNotification object:self.dbNotificationObject];

@ -21,8 +21,6 @@ extern NSString *const StorageIsReadyNotification;
@interface OWSDatabaseConnection : YapDatabaseConnection
@property (atomic, weak) id<OWSDatabaseConnectionDelegate> delegate;
@property (atomic) BOOL isReadOnly;
@property (atomic) BOOL shouldLogLongLived;
- (instancetype)init NS_UNAVAILABLE;
- (instancetype)initWithDatabase:(YapDatabase *)database

@ -81,13 +81,6 @@ NSString *const kNSUserDefaults_DatabaseExtensionVersionMap = @"kNSUserDefaults_
// Specifically, it causes YDB's "view version" checks to fail.
- (void)readWriteWithBlock:(void (^)(YapDatabaseReadWriteTransaction *transaction))block
{
if (self.isReadOnly) {
OWSFail(@"%@ write transaction on read-only connection.", self.logTag);
@throw [NSException exceptionWithName:NSGenericException
reason:@"write transaction on read-only connection."
userInfo:nil];
}
id<OWSDatabaseConnectionDelegate> delegate = self.delegate;
OWSAssert(delegate);
OWSAssert(delegate.areAllRegistrationsComplete);
@ -119,13 +112,6 @@ NSString *const kNSUserDefaults_DatabaseExtensionVersionMap = @"kNSUserDefaults_
OWSAssert(delegate);
OWSAssert(delegate.areAllRegistrationsComplete);
if (self.isReadOnly) {
OWSFail(@"%@ write transaction on read-only connection.", self.logTag);
@throw [NSException exceptionWithName:NSGenericException
reason:@"write transaction on read-only connection."
userInfo:nil];
}
__block OWSBackgroundTask *_Nullable backgroundTask = nil;
if (CurrentAppContext().isMainApp) {
backgroundTask = [OWSBackgroundTask backgroundTaskWithLabelStr:__PRETTY_FUNCTION__];
@ -138,15 +124,6 @@ NSString *const kNSUserDefaults_DatabaseExtensionVersionMap = @"kNSUserDefaults_
}];
}
- (NSArray<NSNotification *> *)beginLongLivedReadTransaction
{
if (self.shouldLogLongLived) {
DDLogInfo(@"%@ %s", self.logTag, __PRETTY_FUNCTION__);
}
return [super beginLongLivedReadTransaction];
}
@end
#pragma mark -

Loading…
Cancel
Save