Skip to content
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

[ASDisplayNode+Layout] Revise subnode orphan checking to run as debug-only assert. #335

Closed
appleguy opened this issue Jun 6, 2017 · 2 comments
Assignees

Comments

@appleguy
Copy link
Member

appleguy commented Jun 6, 2017

Right now, in rare cases it is possible for a node to be orphaned in the hierarchy - when main thread layout is flushed while background calculations are preparing a different layout. Once this is fixed, we should revise the implementation of orphan checking to only run in #if DEBUG and trip an assertion if it occurs.

@nguyenhuy
Copy link
Member

I'm gonna hijack this issue to mention the root cause of orphaned subnodes, as well as subnoes that are never added to the hierarchy. I believe the root cause of these problems is due to the fact that ASLayoutTransition accepts it previous layout in the initializer, instead of at commit time (i.e -commitTransition). It means that the transition assumes that if it's allowed to proceed on main, the previous layout remains valid which is not true if there was layout pass triggered on main via -setNeedsLayout.

There are a couple of things we need to do to fix this problem, as well as to get the layout transition system in a good shape:

appleguy added a commit that referenced this issue Jun 6, 2017
…sition to clean up.

It is rare that this code has any effect, but I've discovered a case in which it occurs.

This task tracks moving this code to a DEBUG-only assertion: #335
appleguy added a commit that referenced this issue Jun 6, 2017
…sition to clean up. (#336)

It is rare that this code has any effect, but I've discovered a case in which it occurs.

This task tracks moving this code to a DEBUG-only assertion: #335
@nguyenhuy nguyenhuy self-assigned this Jun 13, 2017
@nguyenhuy
Copy link
Member

Closing per #336.

bernieperez pushed a commit to AtomTickets/Texture that referenced this issue Apr 25, 2018
…sition to clean up. (TextureGroup#336)

It is rare that this code has any effect, but I've discovered a case in which it occurs.

This task tracks moving this code to a DEBUG-only assertion: TextureGroup#335
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants