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

Regression test: Missing unmount after re-order #20285

Merged
merged 1 commit into from
Nov 18, 2020

Commits on Nov 18, 2020

  1. Regression test: Missing unmount after re-order

    Adds a regression test for a bug I found in the effects refactor.
    
    The bug was that reordering a child that contains passive effects would
    cause the child to "forget" that it contains passive effects. This is
    because when a Placement effect is scheduled by the reconciler, it would
    override all of the fiber's flags, including its "static" ones:
    
    ```
    child.flags = Placement;
    ```
    
    The problem is that we use a static flag to use a "static" flag to track
    that a fiber contains passive effects.
    
    So what happens is that when the tree is deleted, the unmount effect is
    never fired.
    
    In the new implementation, the fix is to add the Placement flag without
    overriding the rest of the bitmask:
    
    ```
    child.flags |= Placement;
    ```
    
    (The old implementation doesn't need to be changed because it does not
    use static flags for this purpose.)
    acdlite committed Nov 18, 2020
    Configuration menu
    Copy the full SHA
    7426d00 View commit details
    Browse the repository at this point in the history