From 050cd8e670f307f7c9b798e9f7c9e8637676e55f Mon Sep 17 00:00:00 2001 From: Krys Jurgowski Date: Fri, 15 Sep 2023 12:20:12 -0700 Subject: [PATCH] Downgrade IGListKit assertion Summary: This assertion has been firing for at least the [last 3 months](https://fburl.com/scuba/errorreporting_instagram_ios_assertions/vfxo4h2g) and we have shipped the app anyways so it is definitely not launch blocking. Reviewed By: fabiomassimo Differential Revision: D49281317 fbshipit-source-id: d525f88fe676e813b8413a2e0f21b6b12728b359 --- Source/IGListDiffKit/IGListAssert.h | 4 ++++ Source/IGListKit/Internal/IGListBatchUpdateTransaction.m | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Source/IGListDiffKit/IGListAssert.h b/Source/IGListDiffKit/IGListAssert.h index f59c2f55a..9a5688428 100644 --- a/Source/IGListDiffKit/IGListAssert.h +++ b/Source/IGListDiffKit/IGListAssert.h @@ -13,6 +13,10 @@ #define IGWarn( condition, ... ) NSCAssert( (condition) , ##__VA_ARGS__) #endif // IGWarn +#ifndef IGWarnAssert +#define IGWarnAssert(frmt, ... ) IGAssert( (NO) , ##__VA_ARGS__) +#endif // IGWarnAssert + #ifndef IGFailAssert #define IGFailAssert( ... ) IGAssert( (NO) , ##__VA_ARGS__) #endif // IGFailAssert diff --git a/Source/IGListKit/Internal/IGListBatchUpdateTransaction.m b/Source/IGListKit/Internal/IGListBatchUpdateTransaction.m index 5bd1d7b66..96ab93bcc 100644 --- a/Source/IGListKit/Internal/IGListBatchUpdateTransaction.m +++ b/Source/IGListKit/Internal/IGListBatchUpdateTransaction.m @@ -143,7 +143,7 @@ - (void)_didDiff:(IGListIndexSetResult *)diffResult onBackground:(BOOL)onBackgro [self _reload]; } else if (self.sectionData && [self.collectionView numberOfSections] != self.sectionData.fromObjects.count) { // If data is nil, there are no section updates. - IGFailAssert(@"The UICollectionView's section count (%li) didn't match the IGListAdapter's count (%li), so we can't performBatchUpdates. Falling back to reloadData.", + IGWarnAssert(@"The UICollectionView's section count (%li) didn't match the IGListAdapter's count (%li), so we can't performBatchUpdates. Falling back to reloadData.", (long)[self.collectionView numberOfSections], (long)self.sectionData.fromObjects.count); [self _reload];