Temporarily make logging around conversation view row updates more verbose.

pull/1/head
Matthew Chen 7 years ago
parent 8e87bd3342
commit 105b033761

@ -2884,7 +2884,8 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
for (YapDatabaseViewRowChange *rowChange in rowChanges) { for (YapDatabaseViewRowChange *rowChange in rowChanges) {
switch (rowChange.type) { switch (rowChange.type) {
case YapDatabaseViewChangeDelete: { case YapDatabaseViewChangeDelete: {
DDLogVerbose(@"YapDatabaseViewChangeDelete: %@, %@", rowChange.collectionKey, rowChange.indexPath); DDLogInfo(@"YapDatabaseViewChangeDelete: %@, %@", rowChange.collectionKey, rowChange.indexPath);
[DDLog flushLog];
[self.collectionView deleteItemsAtIndexPaths:@[ rowChange.indexPath ]]; [self.collectionView deleteItemsAtIndexPaths:@[ rowChange.indexPath ]];
[rowsThatChangedSize removeObject:@(rowChange.indexPath.row)]; [rowsThatChangedSize removeObject:@(rowChange.indexPath.row)];
YapCollectionKey *collectionKey = rowChange.collectionKey; YapCollectionKey *collectionKey = rowChange.collectionKey;
@ -2892,8 +2893,8 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
break; break;
} }
case YapDatabaseViewChangeInsert: { case YapDatabaseViewChangeInsert: {
DDLogVerbose( DDLogInfo(@"YapDatabaseViewChangeInsert: %@, %@", rowChange.collectionKey, rowChange.newIndexPath);
@"YapDatabaseViewChangeInsert: %@, %@", rowChange.collectionKey, rowChange.newIndexPath); [DDLog flushLog];
[self.collectionView insertItemsAtIndexPaths:@[ rowChange.newIndexPath ]]; [self.collectionView insertItemsAtIndexPaths:@[ rowChange.newIndexPath ]];
[rowsThatChangedSize removeObject:@(rowChange.newIndexPath.row)]; [rowsThatChangedSize removeObject:@(rowChange.newIndexPath.row)];
@ -2908,16 +2909,18 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
break; break;
} }
case YapDatabaseViewChangeMove: { case YapDatabaseViewChangeMove: {
DDLogVerbose(@"YapDatabaseViewChangeMove: %@, %@, %@", DDLogInfo(@"YapDatabaseViewChangeMove: %@, %@, %@",
rowChange.collectionKey, rowChange.collectionKey,
rowChange.indexPath, rowChange.indexPath,
rowChange.newIndexPath); rowChange.newIndexPath);
[DDLog flushLog];
[self.collectionView deleteItemsAtIndexPaths:@[ rowChange.indexPath ]]; [self.collectionView deleteItemsAtIndexPaths:@[ rowChange.indexPath ]];
[self.collectionView insertItemsAtIndexPaths:@[ rowChange.newIndexPath ]]; [self.collectionView insertItemsAtIndexPaths:@[ rowChange.newIndexPath ]];
break; break;
} }
case YapDatabaseViewChangeUpdate: { case YapDatabaseViewChangeUpdate: {
DDLogVerbose(@"YapDatabaseViewChangeUpdate: %@, %@", rowChange.collectionKey, rowChange.indexPath); DDLogInfo(@"YapDatabaseViewChangeUpdate: %@, %@", rowChange.collectionKey, rowChange.indexPath);
[DDLog flushLog];
[self.collectionView reloadItemsAtIndexPaths:@[ rowChange.indexPath ]]; [self.collectionView reloadItemsAtIndexPaths:@[ rowChange.indexPath ]];
[rowsThatChangedSize removeObject:@(rowChange.indexPath.row)]; [rowsThatChangedSize removeObject:@(rowChange.indexPath.row)];
break; break;
@ -2929,8 +2932,10 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
// as they may affect which cells show "date" headers or "status" footers. // as they may affect which cells show "date" headers or "status" footers.
NSMutableArray<NSIndexPath *> *rowsToReload = [NSMutableArray new]; NSMutableArray<NSIndexPath *> *rowsToReload = [NSMutableArray new];
for (NSNumber *row in rowsThatChangedSize) { for (NSNumber *row in rowsThatChangedSize) {
DDLogInfo(@"YapDatabaseViewChange reload other row: %@", row);
[rowsToReload addObject:[NSIndexPath indexPathForRow:row.integerValue inSection:0]]; [rowsToReload addObject:[NSIndexPath indexPathForRow:row.integerValue inSection:0]];
} }
[DDLog flushLog];
[self.collectionView reloadItemsAtIndexPaths:rowsToReload]; [self.collectionView reloadItemsAtIndexPaths:rowsToReload];
}; };
void (^batchUpdatesCompletion)(BOOL) = ^(BOOL finished) { void (^batchUpdatesCompletion)(BOOL) = ^(BOOL finished) {
@ -2947,6 +2952,8 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
} }
}; };
DDLogInfo(@"Before performBatchUpdates: %d", shouldAnimateUpdates);
[DDLog flushLog];
if (shouldAnimateUpdates) { if (shouldAnimateUpdates) {
[self.collectionView performBatchUpdates:batchUpdates completion:batchUpdatesCompletion]; [self.collectionView performBatchUpdates:batchUpdates completion:batchUpdatesCompletion];
} else { } else {
@ -2954,6 +2961,8 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
[self.collectionView performBatchUpdates:batchUpdates completion:batchUpdatesCompletion]; [self.collectionView performBatchUpdates:batchUpdates completion:batchUpdatesCompletion];
}]; }];
} }
DDLogInfo(@"After performBatchUpdates");
[DDLog flushLog];
} }
- (BOOL)shouldAnimateRowUpdates:(NSArray<YapDatabaseViewRowChange *> *)rowChanges - (BOOL)shouldAnimateRowUpdates:(NSArray<YapDatabaseViewRowChange *> *)rowChanges

Loading…
Cancel
Save