IGListKit/Source
Maxime Ollivier e3c5cfb59e keep pointer to self.collectionView.dataSource in IGListBatchUpdateTransaction
Summary:
## Issue
We're seeing crashes like this one:

```
Invalid batch updates detected: the number of sections and/or items returned by the data source before and after performing the batch updates are inconsistent with the updates.
Data source before updates = { 6 sections with item counts: [1, 0, 6, 8, 5, 7] }
Data source after updates = { 1 section with item counts: [0] }
Updates = [
]
```

I'm thinking the `IGListAdapter` gets deallocated during an update.
1. `1 section with item counts: [0]` is the default when the `self.collectionView.dataSource` is `nil`. I don't really see a way we'd return a single section with zero cells.
2. We're not seeing any of the additional crash information set by the `IGListAdapterUpdaterDelegate`, which would happen if `IGListAdapter` gets deallocated (it holds the strong pointer to the delegate).

## Fix

Lets keep a strong pointer within the scope of the function to make sure it sticks around. Theoretically, there could be a situation where the section-controller holds a strong pointer to the list-adapter in an update block, which gets released after it runs. This seems pretty unlikely, so lets test this fix to see if that's it.

Reviewed By: candance

Differential Revision: D52747014

fbshipit-source-id: 545aaa3deb90af85a011e716ac870659da42106f
2024-01-17 14:06:13 -08:00
..
IGListDiffKit keep pointer to self.collectionView.dataSource in IGListBatchUpdateTransaction 2024-01-17 14:06:13 -08:00
IGListKit keep pointer to self.collectionView.dataSource in IGListBatchUpdateTransaction 2024-01-17 14:06:13 -08:00
IGListSwiftKit Standarize the copyright notice in all source files 2023-04-06 02:44:16 -07:00
Info.plist Update deployment targets to silence Xcode 14 warnings (#1573) 2023-05-01 22:48:23 -07:00