Commit be0b74b
authored
Check for batch fetching on scroll (#2124)
## Summary
For collection views, we do not currently check for batch fetching on scroll. This appears to be a bug, as `scrollViewDidScroll:` does call `_checkForBatchFetching`, and [the commit that added it states it's trying to check on each scroll](df497b8). Unfortunately, `_checkForBatchFetching` checks for `isTracking` and `isDragging` first and returns if either are `YES`. Since we're in a scroll, they are `YES`. So the call is effectively a no-op.
This bug has been around for 9 years and I'm unsure of the performance implications of turning the batch fetching check on for each scroll tick. Therefore, put the fix behind an experiment feature flag _and_ only call it on the first scroll tick for the scroll session, instead of every scroll tick. Finally, I moved the check after the delegate call, in case the delegate has logic in it to turn on or off the batch fetching.
## Test plan
Ran the app and manually tested batching getting called or not. Also ran `build.sh tests`.1 parent e894389 commit be0b74b
File tree
3 files changed
+19
-2
lines changed- Source
3 files changed
+19
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
145 | 151 | | |
146 | 152 | | |
147 | 153 | | |
| |||
1620 | 1626 | | |
1621 | 1627 | | |
1622 | 1628 | | |
1623 | | - | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
1624 | 1632 | | |
1625 | 1633 | | |
1626 | 1634 | | |
| |||
1630 | 1638 | | |
1631 | 1639 | | |
1632 | 1640 | | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
1633 | 1646 | | |
1634 | 1647 | | |
1635 | 1648 | | |
| |||
1645 | 1658 | | |
1646 | 1659 | | |
1647 | 1660 | | |
| 1661 | + | |
| 1662 | + | |
1648 | 1663 | | |
1649 | 1664 | | |
1650 | 1665 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
0 commit comments