From 1cc0fbcb12fbf696b87417223dcaa365693191af Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Tue, 28 Aug 2018 15:39:15 -0400 Subject: [PATCH] Elaborate logging around 'perform updates' crash. --- .../ConversationViewController.m | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m index 076a499dd..ec8d09c31 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m @@ -3458,6 +3458,40 @@ typedef enum : NSUInteger { exception.name, exception.reason, exception.userInfo); + + for (YapDatabaseViewRowChange *rowChange in rowChanges) { + switch (rowChange.type) { + case YapDatabaseViewChangeDelete: + OWSLogWarn(@"YapDatabaseViewChangeDelete collectionKey: %@, indexPath: %@, finalIndex: %lu", + rowChange.collectionKey, + rowChange.indexPath, + (unsigned long)rowChange.finalIndex); + break; + case YapDatabaseViewChangeInsert: + OWSLogWarn(@"YapDatabaseViewChangeInsert collectionKey: %@, newIndexPath: %@, finalIndex: %lu", + rowChange.collectionKey, + rowChange.newIndexPath, + (unsigned long)rowChange.finalIndex); + break; + case YapDatabaseViewChangeMove: + OWSLogWarn(@"YapDatabaseViewChangeMove collectionKey: %@, indexPath: %@, finalIndex: %@, " + @"finalIndex: %lu", + rowChange.collectionKey, + rowChange.indexPath, + rowChange.newIndexPath, + (unsigned long)rowChange.finalIndex); + break; + case YapDatabaseViewChangeUpdate: + OWSLogWarn(@"YapDatabaseViewChangeUpdate collectionKey: %@, indexPath: %@, finalIndex: %lu, " + @"isDependency: %d", + rowChange.collectionKey, + rowChange.indexPath, + (unsigned long)rowChange.finalIndex, + rowChange.changes == YapDatabaseViewChangedDependency); + break; + } + } + @throw exception; }