IGListKit/Source/IGListDiffKit
Maxime Ollivier d83cf4fced validate the section count before a performBatchUpdate
Summary:
We're seeing some crashes where the `UICollectionView`'s section count doesn't match the `fromObjets`. Ideally that shouldn't happen, but in case it does, lets fallback to a `reloadData` instead of crashing. Lets `IGFailAssert()` to keep an eye on it.

EDIT: Turns out `UICollectionView` will sometimes already do that for item-level inconsistencies! Example error message:
>  The number of items contained in an existing section after the update (9) must be equal to the number of items contained in that section before the update (10), plus or minus the number of items inserted or deleted from that section (0 inserted, 0 deleted) and plus or minus the number of items moved into or out of that section (0 moved in, 0 moved out). - will perform reloadData.

But it still throws a `NSInternalInconsistencyException` for section-level inconsistencies.

Reviewed By: patters

Differential Revision: D23386178

fbshipit-source-id: a9930b619701cffd37d0d6e2bcb1268ef7c9d0ce
2025-12-10 17:18:06 +09:00
..
Internal Run lint on IGListKit 2025-12-10 17:18:05 +09:00
IGListAssert.h Run lint on IGListKit 2025-12-10 17:18:05 +09:00
IGListBatchUpdateData.h remove IGListExperimentFixIndexPathImbalance 2025-12-10 17:18:06 +09:00
IGListBatchUpdateData.mm remove IGListExperimentFixIndexPathImbalance 2025-12-10 17:18:06 +09:00
IGListCompatibility.h Run lint on IGListKit 2025-12-10 17:18:05 +09:00
IGListDiff.h Run lint on IGListKit 2025-12-10 17:18:05 +09:00
IGListDiff.mm remove unused experiment param 2025-12-10 17:18:06 +09:00
IGListDiffable.h Run lint on IGListKit 2025-12-10 17:18:05 +09:00
IGListDiffKit.h Run lint on IGListKit 2025-12-10 17:18:05 +09:00
IGListExperiments.h validate the section count before a performBatchUpdate 2025-12-10 17:18:06 +09:00
IGListIndexPathResult.h Run lint on IGListKit 2025-12-10 17:18:05 +09:00
IGListIndexPathResult.m Run lint on IGListKit 2025-12-10 17:18:05 +09:00
IGListIndexSetResult.h Run lint on IGListKit 2025-12-10 17:18:05 +09:00
IGListIndexSetResult.m Run lint on IGListKit 2025-12-10 17:18:05 +09:00
IGListMacros.h create IGListUpdatingDelegateExperimental 2025-12-10 17:18:06 +09:00
IGListMoveIndex.h Run lint on IGListKit 2025-12-10 17:18:05 +09:00
IGListMoveIndex.m Run lint on IGListKit 2025-12-10 17:18:05 +09:00
IGListMoveIndexPath.h Run lint on IGListKit 2025-12-10 17:18:05 +09:00
IGListMoveIndexPath.m Run lint on IGListKit 2025-12-10 17:18:05 +09:00
NSNumber+IGListDiffable.h Run lint on IGListKit 2025-12-10 17:18:05 +09:00
NSNumber+IGListDiffable.m Run lint on IGListKit 2025-12-10 17:18:05 +09:00
NSString+IGListDiffable.h Run lint on IGListKit 2025-12-10 17:18:05 +09:00
NSString+IGListDiffable.m Run lint on IGListKit 2025-12-10 17:18:05 +09:00