IGListKit/Source
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
..
IGListDiffKit Fix the visibleObjects inconsistency assertion 2020-10-17 02:05:24 -07:00
IGListKit Fix the visibleObjects inconsistency assertion 2020-10-17 02:05:24 -07:00
IGListSwiftKit Replace if let with guard let (#1466) 2020-10-12 14:29:11 -07:00
Info.plist Refine dequeueReusableCellOfClass methods for Swift (#1388) 2019-12-19 08:13:22 -08:00