IGListKit/Source/IGListDiffKit
Zhisheng Huang 6311bbcfb4 Fix the visibleObjects inconsistency assertion
Summary:
Another source-of-truth inconsistency issue.

I kept getting this assertion T65423827 task.
It turned out the the root cause is that we use the `_viewSectionControllerMap` to keep track of the mapping between view and section controller.

Which is dangerous.
Because the UICV's source of truth is the `sectionMap`, now we are adding another source of truth between view <-> sectionController to be `_viewSectionControllerMap`, this is just waiting for bugs to happen.

We should always refers to sectionMap as the source of truth for everything here: since we can get the section index, we can replace all the `-sectionControllerForView` to use `-sectionControllerForSection:` instead, which is safer.

Multiple source of truth is the bug for this unexpected assertion.

Once we can cleanup this, then we dont need to use that weird: `- (void)mapView:(UICollectionReusableView *)view toSectionController:(IGListSectionController *)sectionController` API which we might forget to map, that can cause bug.

Reviewed By: elfredpagan

Differential Revision: D24173911

fbshipit-source-id: 6138cafc0b382fc569d17b14b13a6b50d85d342d
2020-10-17 02:05:24 -07:00
..
Internal Run lint on IGListKit 2019-12-19 09:34:42 -08:00
IGListAssert.h Run lint on IGListKit 2019-12-19 09:34:42 -08:00
IGListBatchUpdateData.h remove IGListExperimentFixIndexPathImbalance 2020-06-02 13:04:26 -07:00
IGListBatchUpdateData.mm remove IGListExperimentFixIndexPathImbalance 2020-06-02 13:04:26 -07:00
IGListCompatibility.h Run lint on IGListKit 2019-12-19 09:34:42 -08:00
IGListDiff.h Run lint on IGListKit 2019-12-19 09:34:42 -08:00
IGListDiff.mm remove unused experiment param 2020-09-08 09:11:11 -07:00
IGListDiffable.h Run lint on IGListKit 2019-12-19 09:34:42 -08:00
IGListDiffKit.h Run lint on IGListKit 2019-12-19 09:34:42 -08:00
IGListExperiments.h Fix the visibleObjects inconsistency assertion 2020-10-17 02:05:24 -07:00
IGListIndexPathResult.h Run lint on IGListKit 2019-12-19 09:34:42 -08:00
IGListIndexPathResult.m Run lint on IGListKit 2019-12-19 09:34:42 -08:00
IGListIndexSetResult.h Run lint on IGListKit 2019-12-19 09:34:42 -08:00
IGListIndexSetResult.m Run lint on IGListKit 2019-12-19 09:34:42 -08:00
IGListMacros.h create IGListUpdatingDelegateExperimental 2020-09-08 09:11:11 -07:00
IGListMoveIndex.h Run lint on IGListKit 2019-12-19 09:34:42 -08:00
IGListMoveIndex.m Run lint on IGListKit 2019-12-19 09:34:42 -08:00
IGListMoveIndexPath.h Run lint on IGListKit 2019-12-19 09:34:42 -08:00
IGListMoveIndexPath.m Run lint on IGListKit 2019-12-19 09:34:42 -08:00
NSNumber+IGListDiffable.h Run lint on IGListKit 2019-12-19 09:34:42 -08:00
NSNumber+IGListDiffable.m Run lint on IGListKit 2019-12-19 09:34:42 -08:00
NSString+IGListDiffable.h Run lint on IGListKit 2019-12-19 09:34:42 -08:00
NSString+IGListDiffable.m Run lint on IGListKit 2019-12-19 09:34:42 -08:00