diff --git a/Source/IGListDiffKit/IGListBatchUpdateData.h b/Source/IGListDiffKit/IGListBatchUpdateData.h index a66403288..226c1baf6 100644 --- a/Source/IGListDiffKit/IGListBatchUpdateData.h +++ b/Source/IGListDiffKit/IGListBatchUpdateData.h @@ -67,6 +67,7 @@ NS_SWIFT_NAME(ListBatchUpdateData) @param deleteIndexPaths Item index paths to delete. @param updateIndexPaths Item index paths to update. @param moveIndexPaths Item index paths to move. + @param enableNetItemCountFix Fix item count balance issue when removing duplicate deletes @return A new batch update object. */ @@ -76,7 +77,8 @@ NS_SWIFT_NAME(ListBatchUpdateData) insertIndexPaths:(NSArray *)insertIndexPaths deleteIndexPaths:(NSArray *)deleteIndexPaths updateIndexPaths:(NSArray *)updateIndexPaths - moveIndexPaths:(NSArray *)moveIndexPaths NS_DESIGNATED_INITIALIZER; + moveIndexPaths:(NSArray *)moveIndexPaths + enableNetItemCountFix:(BOOL)enableNetItemCountFix NS_DESIGNATED_INITIALIZER; /** :nodoc: diff --git a/Source/IGListDiffKit/IGListBatchUpdateData.mm b/Source/IGListDiffKit/IGListBatchUpdateData.mm index b55c1ac1f..7364e44bd 100644 --- a/Source/IGListDiffKit/IGListBatchUpdateData.mm +++ b/Source/IGListDiffKit/IGListBatchUpdateData.mm @@ -61,7 +61,8 @@ - (instancetype)initWithInsertSections:(nonnull NSIndexSet *)insertSections insertIndexPaths:(nonnull NSArray *)insertIndexPaths deleteIndexPaths:(nonnull NSArray *)deleteIndexPaths updateIndexPaths:(nonnull NSArray *)updateIndexPaths - moveIndexPaths:(nonnull NSArray *)moveIndexPaths { + moveIndexPaths:(nonnull NSArray *)moveIndexPaths + enableNetItemCountFix:(BOOL)enableNetItemCountFix { IGParameterAssert(insertSections != nil); IGParameterAssert(deleteSections != nil); IGParameterAssert(moveSections != nil); @@ -95,11 +96,40 @@ - (instancetype)initWithInsertSections:(nonnull NSIndexSet *)insertSections toMap[to] = move; } } + + NSMutableArray *mDeleteIndexPaths; + NSMutableArray *mInsertIndexPaths; - // avoid a flaky UICollectionView bug when deleting from the same index path twice + // Avoid a flaky UICollectionView bug when deleting from the same index path twice // exposes a possible data source inconsistency issue - NSMutableArray *mDeleteIndexPaths = [[[NSSet setWithArray:deleteIndexPaths] allObjects] mutableCopy]; - NSMutableArray *mInsertIndexPaths = [insertIndexPaths mutableCopy]; + if (enableNetItemCountFix) { + NSMutableDictionary *const deleteCounts = [NSMutableDictionary new]; + + // If we need to remove a duplicate delete, we also need to remove an insert to balance the count. + // Lets build the delete counts for each index, which we can use to skip corresponding inserts. + for (NSIndexPath *deleteIndexPath in deleteIndexPaths) { + const NSInteger deleteCount = deleteCounts[deleteIndexPath].integerValue; + deleteCounts[deleteIndexPath] = @(deleteCount + 1); + } + + // Skip inserts that have an associated skipped delete + NSMutableArray *const trimmedInsertIndexPath = [NSMutableArray new]; + for (NSIndexPath *insertIndexPath in insertIndexPaths) { + const NSInteger deleteCount = deleteCounts[insertIndexPath].integerValue; + if (deleteCount > 1) { + // Skip! + deleteCounts[insertIndexPath] = @(deleteCount - 1); + } else { + [trimmedInsertIndexPath addObject:insertIndexPath]; + } + } + + mDeleteIndexPaths = [[deleteCounts allKeys] mutableCopy]; + mInsertIndexPaths = trimmedInsertIndexPath; + } else { + mDeleteIndexPaths = [[[NSSet setWithArray:deleteIndexPaths] allObjects] mutableCopy]; + mInsertIndexPaths = [insertIndexPaths mutableCopy]; + } // avoids a bug where a cell is animated twice and one of the snapshot cells is never removed from the hierarchy [IGListBatchUpdateData _cleanIndexPathsWithMap:fromMap moves:mMoveSections indexPaths:mDeleteIndexPaths deletes:mDeleteSections inserts:mInsertSections]; diff --git a/Source/IGListDiffKit/IGListExperiments.h b/Source/IGListDiffKit/IGListExperiments.h index d2c3d9b90..cb72bc7ff 100644 --- a/Source/IGListDiffKit/IGListExperiments.h +++ b/Source/IGListDiffKit/IGListExperiments.h @@ -22,6 +22,8 @@ typedef NS_OPTIONS (NSInteger, IGListExperiment) { IGListExperimentThrowOnInconsistencyException = 1 << 3, /// Remove the early exit so multiple updates can't happen at once IGListExperimentRemoveDataSourceChangeEarlyExit = 1 << 4, + /// Fix item count balance issue when removing duplicate deletes + IGListExperimentEnableNetItemCountFix = 1 << 5, }; /** diff --git a/Source/IGListKit/Internal/IGListAdapterUpdaterHelpers.h b/Source/IGListKit/Internal/IGListAdapterUpdaterHelpers.h index 7766714ea..b0414db5a 100644 --- a/Source/IGListKit/Internal/IGListAdapterUpdaterHelpers.h +++ b/Source/IGListKit/Internal/IGListAdapterUpdaterHelpers.h @@ -30,7 +30,8 @@ IGListBatchUpdateData *IGListApplyUpdatesToCollectionView(UICollectionView *coll NSMutableArray *itemMoves, NSArray> *fromObjects, BOOL sectionMovesAsDeletesInserts, - BOOL preferItemReloadsForSectionReloads); + BOOL preferItemReloadsForSectionReloads, + BOOL enableNetItemCountFix); NSIndexSet *IGListSectionIndexFromIndexPaths(NSArray *indexPaths); diff --git a/Source/IGListKit/Internal/IGListAdapterUpdaterHelpers.m b/Source/IGListKit/Internal/IGListAdapterUpdaterHelpers.m index b36bb53b6..5a3f4567f 100644 --- a/Source/IGListKit/Internal/IGListAdapterUpdaterHelpers.m +++ b/Source/IGListKit/Internal/IGListAdapterUpdaterHelpers.m @@ -68,7 +68,8 @@ void IGListConvertReloadToDeleteInsert(NSMutableIndexSet *reloads, NSMutableArray *itemMoves, NSArray> *fromObjects, BOOL sectionMovesAsDeletesInserts, - BOOL preferItemReloadsForSectionReloads) { + BOOL preferItemReloadsForSectionReloads, + BOOL enableNetItemCountFix) { NSSet *moves = [[NSSet alloc] initWithArray:diffResult.moves]; // combine section reloads from the diff and manual reloads via reloadItems: @@ -125,7 +126,8 @@ void IGListConvertReloadToDeleteInsert(NSMutableIndexSet *reloads, insertIndexPaths:itemInserts deleteIndexPaths:itemDeletes updateIndexPaths:itemUpdates - moveIndexPaths:itemMoves]; + moveIndexPaths:itemMoves + enableNetItemCountFix:enableNetItemCountFix]; [collectionView ig_applyBatchUpdateData:updateData]; return updateData; } diff --git a/Source/IGListKit/Internal/IGListBatchUpdateTransaction.m b/Source/IGListKit/Internal/IGListBatchUpdateTransaction.m index d81083292..82f4dba7c 100644 --- a/Source/IGListKit/Internal/IGListBatchUpdateTransaction.m +++ b/Source/IGListKit/Internal/IGListBatchUpdateTransaction.m @@ -241,6 +241,7 @@ - (void)_applyDataUpdates { } - (void)_applyCollectioViewUpdates:(IGListIndexSetResult *)diffResult { + const BOOL enableNetItemCountFix = IGListExperimentEnabled(self.config.experiments, IGListExperimentEnableNetItemCountFix); if (self.config.singleItemSectionUpdates) { [self.collectionView deleteSections:diffResult.deletes]; [self.collectionView insertSections:diffResult.inserts]; @@ -256,7 +257,8 @@ - (void)_applyCollectioViewUpdates:(IGListIndexSetResult *)diffResult { insertIndexPaths:@[] deleteIndexPaths:@[] updateIndexPaths:@[] - moveIndexPaths:@[]]; + moveIndexPaths:@[] + enableNetItemCountFix:enableNetItemCountFix]; } else { self.actualCollectionViewUpdates = IGListApplyUpdatesToCollectionView(self.collectionView, diffResult, @@ -267,7 +269,8 @@ - (void)_applyCollectioViewUpdates:(IGListIndexSetResult *)diffResult { self.inUpdateItemCollector.itemMoves, self.sectionData.fromObjects ?: @[], self.config.sectionMovesAsDeletesInserts, - self.config.preferItemReloadsForSectionReloads); + self.config.preferItemReloadsForSectionReloads, + enableNetItemCountFix); } } diff --git a/Tests/IGListAdapterUpdaterTests.m b/Tests/IGListAdapterUpdaterTests.m index c15b3c09a..d41e2e58b 100644 --- a/Tests/IGListAdapterUpdaterTests.m +++ b/Tests/IGListAdapterUpdaterTests.m @@ -779,7 +779,8 @@ - (void)test_whenReloadIsCalledWithSameItemCount_deleteInsertSectionHappen { insertIndexPaths:@[] deleteIndexPaths:@[] updateIndexPaths:@[] - moveIndexPaths:@[]]; + moveIndexPaths:@[] + enableNetItemCountFix:NO]; NSArray *from = @[[IGSectionObject sectionWithObjects:@[@1] identifier:@"id"]]; NSArray *to = @[[IGSectionObject sectionWithObjects:@[@2] identifier:@"id"]]; self.dataSource.sections = from; @@ -996,7 +997,8 @@ - (void)test_whenReloadIsCalledWithSameItemCount_andPreferItemReload_updateIndex insertIndexPaths:@[] deleteIndexPaths:@[] updateIndexPaths:@[[NSIndexPath indexPathForItem:0 inSection:0]] - moveIndexPaths:@[]]; + moveIndexPaths:@[] + enableNetItemCountFix:NO]; NSArray *from = @[[IGSectionObject sectionWithObjects:@[@1] identifier:@"id"]]; // Update the items NSArray *to = @[[IGSectionObject sectionWithObjects:@[@2] identifier:@"id"]]; @@ -1031,7 +1033,8 @@ - (void)test_whenReloadIsCalledWithDifferentItemCount_andPreferItemReload_delete insertIndexPaths:@[] deleteIndexPaths:@[] updateIndexPaths:@[] - moveIndexPaths:@[]]; + moveIndexPaths:@[] + enableNetItemCountFix:NO]; NSArray *from = @[[IGSectionObject sectionWithObjects:@[@1] identifier:@"id"]]; // more items in the section NSArray *to = @[[IGSectionObject sectionWithObjects:@[@1, @2] identifier:@"id"]]; @@ -1067,7 +1070,8 @@ - (void)test_whenReloadIsCalledWithSectionMoveAndUpdate_andPreferItemReload_dele insertIndexPaths:@[] deleteIndexPaths:@[] updateIndexPaths:@[] - moveIndexPaths:@[]]; + moveIndexPaths:@[] + enableNetItemCountFix:NO]; NSArray *from = @[[IGSectionObject sectionWithObjects:@[@1] identifier:@"id1"], [IGSectionObject sectionWithObjects:@[@2] identifier:@"id2"]]; // move section, and also update the item for "id2" @@ -1109,7 +1113,8 @@ - (void)test_whenReloadIsCalledWithSectionMoveAndUpdate_withDifferentSectionLeng insertIndexPaths:@[] deleteIndexPaths:@[] updateIndexPaths:@[] - moveIndexPaths:@[]]; + moveIndexPaths:@[] + enableNetItemCountFix:NO]; NSArray *from = @[[IGSectionObject sectionWithObjects:@[@1, @2, @3] identifier:@"id1"], [IGSectionObject sectionWithObjects:@[@2] identifier:@"id2"]]; // move section, and also update the item for "id2" @@ -1152,7 +1157,8 @@ - (void)test_whenReloadIsCalledWithSectionMoveAndUpdate_withThreeSections_delete insertIndexPaths:@[] deleteIndexPaths:@[] updateIndexPaths:@[] - moveIndexPaths:@[]]; + moveIndexPaths:@[] + enableNetItemCountFix:NO]; NSArray *from = @[[IGSectionObject sectionWithObjects:@[@1] identifier:@"id1"], [IGSectionObject sectionWithObjects:@[@2] identifier:@"id2"], [IGSectionObject sectionWithObjects:@[@3] identifier:@"id3"]]; @@ -1195,7 +1201,8 @@ - (void)test_whenReloadIsCalledWithSectionInsertAndUpdate_andPreferItemReload_no insertIndexPaths:@[] deleteIndexPaths:@[] updateIndexPaths:@[] - moveIndexPaths:@[]]; + moveIndexPaths:@[] + enableNetItemCountFix:NO]; NSArray *from = @[[IGSectionObject sectionWithObjects:@[@1] identifier:@"id1"]]; NSArray *to = @[[IGSectionObject sectionWithObjects:@[@2] identifier:@"id1"], [IGSectionObject sectionWithObjects:@[@22] identifier:@"id2"]]; diff --git a/Tests/IGListBatchUpdateDataTests.m b/Tests/IGListBatchUpdateDataTests.m index 90ae90260..7b0633982 100644 --- a/Tests/IGListBatchUpdateDataTests.m +++ b/Tests/IGListBatchUpdateDataTests.m @@ -49,7 +49,8 @@ - (void)test_whenEmptyUpdates_thatResultExists { insertIndexPaths:@[] deleteIndexPaths:@[] updateIndexPaths:@[] - moveIndexPaths:@[]]; + moveIndexPaths:@[] + enableNetItemCountFix:NO]; XCTAssertNotNil(result); } @@ -60,7 +61,8 @@ - (void)test_whenUpdatesAreClean_thatResultMatches { insertIndexPaths:@[newPath(0, 0)] deleteIndexPaths:@[newPath(1, 0)] updateIndexPaths:@[] - moveIndexPaths:@[newMovePath(6, 0, 6, 1)]]; + moveIndexPaths:@[newMovePath(6, 0, 6, 1)] + enableNetItemCountFix:NO]; XCTAssertEqualObjects(result.insertSections, indexSet(@[@0, @1])); XCTAssertEqualObjects(result.deleteSections, indexSet(@[@5])); XCTAssertEqualObjects(result.moveSections, [NSSet setWithArray:@[newMove(3, 4)]]); @@ -77,7 +79,8 @@ - (void)test_whenMovingSections_withItemDeletes_thatResultConvertsConflicts_toDe insertIndexPaths:@[] deleteIndexPaths:@[newPath(2, 0), newPath(3, 4)] updateIndexPaths:@[] - moveIndexPaths:@[]]; + moveIndexPaths:@[] + enableNetItemCountFix:NO]; XCTAssertEqualObjects(result.insertSections, indexSet(@[@4])); XCTAssertEqualObjects(result.deleteSections, indexSet(@[@2])); XCTAssertEqualObjects(result.deleteIndexPaths, @[newPath(3, 4)]); @@ -91,7 +94,8 @@ - (void)test_whenMovingSections_withItemInserts_thatResultConvertsConflicts_toDe insertIndexPaths:@[newPath(4, 0), newPath(3, 4)] deleteIndexPaths:@[] updateIndexPaths:@[] - moveIndexPaths:@[]]; + moveIndexPaths:@[] + enableNetItemCountFix:NO]; XCTAssertEqualObjects(result.insertSections, indexSet(@[@4])); XCTAssertEqualObjects(result.deleteSections, indexSet(@[@2])); XCTAssertEqualObjects(result.insertIndexPaths, @[newPath(3, 4)]); @@ -105,7 +109,8 @@ - (void)test_whenMovingIndexPaths_withSectionDeleted_thatResultDropsTheMove { insertIndexPaths:@[] deleteIndexPaths:@[] updateIndexPaths:@[] - moveIndexPaths:@[newMovePath(0, 0, 0, 1)]]; + moveIndexPaths:@[newMovePath(0, 0, 0, 1)] + enableNetItemCountFix:NO]; XCTAssertEqual(result.moveIndexPaths.count, 0); XCTAssertEqualObjects(result.deleteSections, indexSet(@[@0])); } @@ -117,7 +122,8 @@ - (void)test_whenMovingIndexPaths_withSectionMoved_thatResultConvertsToDeletesAn insertIndexPaths:@[] deleteIndexPaths:@[] updateIndexPaths:@[] - moveIndexPaths:@[newMovePath(0, 0, 0, 1)]]; + moveIndexPaths:@[newMovePath(0, 0, 0, 1)] + enableNetItemCountFix:NO]; XCTAssertEqual(result.moveIndexPaths.count, 0); XCTAssertEqual(result.moveSections.count, 0); XCTAssertEqualObjects(result.deleteSections, indexSet(@[@0])); @@ -131,7 +137,8 @@ - (void)test_whenMovingSections_withMoveFromConflictWithDelete_thatResultDropsTh insertIndexPaths:@[] deleteIndexPaths:@[] updateIndexPaths:@[] - moveIndexPaths:@[]]; + moveIndexPaths:@[] + enableNetItemCountFix:NO]; XCTAssertEqual(result.deleteSections.count, 1); XCTAssertEqual(result.moveSections.count, 1); XCTAssertEqual(result.insertSections.count, 0); @@ -146,11 +153,100 @@ - (void)test_whenDeletingSameIndexPathMultipleTimes_thatResultDropsTheDuplicates insertIndexPaths:@[] deleteIndexPaths:@[newPath(2, 0), newPath(2, 0)] updateIndexPaths:@[] - moveIndexPaths:@[]]; + moveIndexPaths:@[] + enableNetItemCountFix:NO]; XCTAssertEqualObjects(result.deleteIndexPaths, @[newPath(2, 0)]); } +- (void)test_whenNoInsertingAndDeletingTwice_withNetItemCountFix_thatResultDropsTheDuplicatesWithKeepsSameNetItemCount { + IGListBatchUpdateData *result = [[IGListBatchUpdateData alloc] initWithInsertSections:indexSet(@[]) + deleteSections:indexSet(@[]) + moveSections:[NSSet new] + insertIndexPaths:@[] + deleteIndexPaths:@[newPath(2, 0), newPath(2, 0)] + updateIndexPaths:@[] + moveIndexPaths:@[] + enableNetItemCountFix:YES]; + + XCTAssertEqualObjects(result.insertIndexPaths, @[]); + XCTAssertEqualObjects(result.deleteIndexPaths, @[newPath(2, 0)]); +} + +- (void)test_whenInsertingOnceAndDeletingTwice_withNetItemCountFix_thatResultDropsTheDuplicatesWithKeepsSameNetItemCount { + IGListBatchUpdateData *result = [[IGListBatchUpdateData alloc] initWithInsertSections:indexSet(@[]) + deleteSections:indexSet(@[]) + moveSections:[NSSet new] + insertIndexPaths:@[newPath(2, 0)] + deleteIndexPaths:@[newPath(2, 0), newPath(2, 0)] + updateIndexPaths:@[] + moveIndexPaths:@[] + enableNetItemCountFix:YES]; + // Should remove one insert + XCTAssertEqualObjects(result.insertIndexPaths, @[]); + XCTAssertEqualObjects(result.deleteIndexPaths, @[newPath(2, 0)]); +} + +- (void)test_whenInsertingTwiceAndDeletingTwice_withNetItemCountFix_thatResultDropsTheDuplicatesWithKeepsSameNetItemCount { + IGListBatchUpdateData *result = [[IGListBatchUpdateData alloc] initWithInsertSections:indexSet(@[]) + deleteSections:indexSet(@[]) + moveSections:[NSSet new] + insertIndexPaths:@[newPath(2, 0), newPath(2, 0)] + deleteIndexPaths:@[newPath(2, 0), newPath(2, 0)] + updateIndexPaths:@[] + moveIndexPaths:@[] + enableNetItemCountFix:YES]; + + // Should remove one insert + XCTAssertEqualObjects(result.insertIndexPaths, @[newPath(2, 0)]); + XCTAssertEqualObjects(result.deleteIndexPaths, @[newPath(2, 0)]); +} + +- (void)test_whenInsertingThriceAndDeletingTwice_withNetItemCountFix_thatResultDropsTheDuplicatesWithKeepsSameNetItemCount { + IGListBatchUpdateData *result = [[IGListBatchUpdateData alloc] initWithInsertSections:indexSet(@[]) + deleteSections:indexSet(@[]) + moveSections:[NSSet new] + insertIndexPaths:@[newPath(2, 0), newPath(2, 0), newPath(2, 0)] + deleteIndexPaths:@[newPath(2, 0), newPath(2, 0)] + updateIndexPaths:@[] + moveIndexPaths:@[] + enableNetItemCountFix:YES]; + + // Should remove one insert + NSArray *const expectedInsertIndexPaths = @[newPath(2, 0), newPath(2, 0)]; + XCTAssertEqualObjects(result.insertIndexPaths, expectedInsertIndexPaths); + XCTAssertEqualObjects(result.deleteIndexPaths, @[newPath(2, 0)]); +} + +- (void)test_whenInsertingThriceAndDeletingThrice_withNetItemCountFix_thatResultDropsTheDuplicatesWithKeepsSameNetItemCount { + IGListBatchUpdateData *result = [[IGListBatchUpdateData alloc] initWithInsertSections:indexSet(@[]) + deleteSections:indexSet(@[]) + moveSections:[NSSet new] + insertIndexPaths:@[newPath(2, 0), newPath(2, 0), newPath(2, 0)] + deleteIndexPaths:@[newPath(2, 0), newPath(2, 0), newPath(2, 0)] + updateIndexPaths:@[] + moveIndexPaths:@[] + enableNetItemCountFix:YES]; + + // Should remove 2 inserts + XCTAssertEqualObjects(result.insertIndexPaths, @[newPath(2, 0)]); + XCTAssertEqualObjects(result.deleteIndexPaths, @[newPath(2, 0)]); +} + +- (void)test_whenInsertingOnceAndDeletingOnce_withNetItemCountFix_thatNoThingChanges { + IGListBatchUpdateData *result = [[IGListBatchUpdateData alloc] initWithInsertSections:indexSet(@[]) + deleteSections:indexSet(@[]) + moveSections:[NSSet new] + insertIndexPaths:@[newPath(2, 0)] + deleteIndexPaths:@[newPath(2, 0)] + updateIndexPaths:@[] + moveIndexPaths:@[] + enableNetItemCountFix:YES]; + + XCTAssertEqualObjects(result.insertIndexPaths, @[newPath(2, 0)]); + XCTAssertEqualObjects(result.deleteIndexPaths, @[newPath(2, 0)]); +} + - (void)test_whenUpdatesAreClean_thatObjectIsEqualToItself { IGListBatchUpdateData *result = [[IGListBatchUpdateData alloc] initWithInsertSections:indexSet(@[@0, @1]) deleteSections:indexSet(@[@5]) @@ -158,7 +254,8 @@ - (void)test_whenUpdatesAreClean_thatObjectIsEqualToItself { insertIndexPaths:@[newPath(0, 0)] deleteIndexPaths:@[newPath(1, 0)] updateIndexPaths:@[] - moveIndexPaths:@[newMovePath(6, 0, 6, 1)]]; + moveIndexPaths:@[newMovePath(6, 0, 6, 1)] + enableNetItemCountFix:NO]; XCTAssertTrue([result isEqual:result]); } @@ -169,7 +266,8 @@ - (void)test_whenEmptyUpdates_thatResultDoesNotEqualOtherClasses { insertIndexPaths:@[] deleteIndexPaths:@[] updateIndexPaths:@[] - moveIndexPaths:@[]]; + moveIndexPaths:@[] + enableNetItemCountFix:NO]; XCTAssertFalse([emptyResult isEqual:[NSObject new]]); } diff --git a/Tests/IGListDebugDescriptionTests.m b/Tests/IGListDebugDescriptionTests.m index 9811b21ce..9ec55090b 100644 --- a/Tests/IGListDebugDescriptionTests.m +++ b/Tests/IGListDebugDescriptionTests.m @@ -103,7 +103,8 @@ - (void)test_withBatchUpdateData_thatDebugDescriptionIsValid { insertIndexPaths:@[insertIndexPaths] deleteIndexPaths:@[deleteIndexPaths] updateIndexPaths:@[] - moveIndexPaths:@[moveIndexPaths]]; + moveIndexPaths:@[moveIndexPaths] + enableNetItemCountFix:NO]; XCTAssertTrue(data.debugDescriptionLines.count > 0); } diff --git a/Tests/IGListDiffDescriptionStringTests.m b/Tests/IGListDiffDescriptionStringTests.m index 3c50a0683..2c1c1f5d0 100644 --- a/Tests/IGListDiffDescriptionStringTests.m +++ b/Tests/IGListDiffDescriptionStringTests.m @@ -39,7 +39,8 @@ - (void)test_withBatchUpdateData_thatDescriptionStringIsValid { insertIndexPaths:@[insertIndexPaths] deleteIndexPaths:@[deleteIndexPaths] updateIndexPaths:@[] - moveIndexPaths:@[moveIndexPaths]]; + moveIndexPaths:@[moveIndexPaths] + enableNetItemCountFix:NO]; NSString *expectedDescription = [NSString stringWithFormat:@"