-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a way to opt out of always-clear-data behavior in ASCollectionView and ASTableView #1284
Conversation
…ng deallocation and in the experiment
I don't think this is the right logic either as it would change the initial behavior. In this case we would have to enable the I would suggest we add an overall experimental feature and change the logic to something like this:
|
The thing is we don’t want to keep the original behavior (i.e always call clearData). The implementation of clearData is problematic, both while the collection view is being used and when it’s being deallocated.
That is intended as I understand it helps to workaround the root cause. It's an opt-in workaround. However, the implementation in #1200 and the one you proposed here doesn't give us an easy option to opt-out of the initial behavior which has been causing crashes. |
Ok, I've just updated the logic to check the experiment first. It means you'll have room to test other cases in which clearing data is needed. I still think it should be opt-in as we don't want to keep the original problematic behavior. |
🚫 CI failed with log |
@nguyenhuy Would be great to have this PR not change the standard behavior where it clears by default. Applications still rely on this behavior and we can not make it opt in. We should make the new behavior (clear only on deallocation) opt in it until all bigger clients of Texture can agree what the final behavior we should strive for. |
Through crashes in the past, we established that:
ASExperimentalClearDataDuringDeallocation
experiment.As such, the logic change introduced in #1200 is not correct. It causes
-clearData
to always be executed if user is not in the experiment (which is true by default).I suspect what you wanted to do is setting up an experiment and hook up with Texture. And even then, we need to fix the implementation of
clearData
. I'm seeing a crash in production (1st screenshot below) which looks like a memory issue whenself
(i.e the collection view) is gone and accessing the editing queue (i.eself->_editingTransactionGroup
) after that is problematic (see 2nd screenshot).I think
clearData
needs to avoid calling-waitUntilAllUpdatesAreProcessed
altogether. Instead, it needs to: