-
Couldn't load subscription status.
- Fork 2.2k
Don't Eagerly Trigger Relayout in Wait #3134
Conversation
|
I haven't run tests locally so they may fail. I will adjust them later. |
|
I've modified the tests to add the manual The context here is:
|
|
@Adlai-Holler I have also had issues with 0, 0 layouts. It does seem important though that this method behaves consistently, e.g. a user should not have to know if the layout pass has occurred for waitUntilAllOperationsAreCommitted to "work". We really should rename this method, but I would guess the desired semantics are like "flush": "ensure UIKit is completely up to date with the current state of the asyncDataSource, whether or not initial load has happened, and including any edit operations recently performed" |
|
maybe we could call this waitOnLayout, flushLayout, or updateSynchronously? |
|
@appleguy I agree. My current estimate is, that it should trigger the initial data load to start if needed, but otherwise not trigger a layout pass. |
|
@Adlai-Holler: thanks for working on this. I forced a layout pass in '-waitUntilAllUpdatesAreCommitted' to avoid a breaking behavioral change in that method. Many users have used it as a way to ensure all updates were "flushed" and the collection/table is up-to-date with its data source. Our tests also relies on this behavior. But now that we do native reloadData, that expectation won't be true until the next layout pass happens. Renaming is probably a great idea. I'd prefer a breaking API change that the compiler will pick up over a silent breaking behavioral change. Edit: sorry I misspelled your name, Adlai! |
|
We need to be careful to separate two issues here:
|
|
Since this is causing immediate issues in Pinterest, I'm landing this for now and we can continue discussion about this later. |
This was added in #3017 and it's causing some issues for Pinterest, due to it triggering the initial load of data for collections that are
(0, 0). @nguyenhuy Do you remember the details of why this was added?