Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: facebook/react
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 343710c9230d643ec442acef4634e380c1f0bce9
Choose a base ref
...
head repository: facebook/react
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: e22a98458b78c224756791023157938391416cc9
Choose a head ref
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on Apr 11, 2021

  1. Bugfix: Don't rely on finishedLanes for passive effects

    I recently started using `pendingPassiveEffectsLanes` to check if there were any pending
    passive effects (530027a). `pendingPassiveEffectsLanes` is the value of
    `root.finishedLanes` at the beginning of the commit phase. When there
    are pending passive effects, it should always be a non-zero value,
    because it represents the lanes used to render the effects.
    
    But it turns out that `root.finishedLanes` isn't always correct.
    Sometimes it's `NoLanes` even when there's a new commit.
    
    I found this while investigating an internal bug report. The only repro
    I could get was via a headless e2e test runner; I couldn't get one in an
    actual browser, or other interactive environment. I used the e2e test to
    bisect and confirm the fix. But I don't know yet know how to write a
    regression test for the precise underlying scenario. I can probably
    reverse engineer one by studying the code; after a quick glance
    at `performConcurrentWorkOnRoot` and `performSyncWorkOnRoot`, it's not
    hard to see how this might happen.
    
    In the meantime, I'll revert the recent change that exposed the bug.
    
    I was surprised that this had never come up before, since the code that
    assigns `root.finishedLanes` is in an extremely hot path, and it hasn't
    changed in a while. The reason is that, before 530027a,
    `root.finishedLanes` was only used by the DevTools profiler, which is
    probably why we had never noticed any issues. In addition to fixing the
    inconsistency, we might also consider making `finishedLanes` a
    profiling-only field.
    acdlite committed Apr 11, 2021
    Configuration menu
    Copy the full SHA
    e22a984 View commit details
    Browse the repository at this point in the history
Loading