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

Bug: Redundant Operation in getEntangledLanes Function Doesn't Modify entangledLanes as Intended #31816

Open
Acabbage opened this issue Dec 17, 2024 · 0 comments
Labels
Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug

Comments

@Acabbage
Copy link

Description:

In the getEntangledLanes function, there appears to be a redundant operation inside the if statement that doesn't alter the value of entangledLanes as intended. This might be a bug or oversight in the implementation.

Code Snippet:

export function getEntangledLanes(root: FiberRoot, renderLanes: Lanes): Lanes {
  let entangledLanes = renderLanes;

  if ((entangledLanes & InputContinuousLane) !== NoLanes) {
    // When updates are sync by default, we entangle continuous priority updates
    // and default updates, so they render in the same batch. The only reason
    // they use separate lanes is because continuous updates should interrupt
    // transitions, but default updates should not.
    entangledLanes |= entangledLanes & DefaultLane;
  }

  // ... rest of the function ...
}

Problem Description:

In the if statement, the intention seems to be to entangle DefaultLane with InputContinuousLane when entangledLanes includes InputContinuousLane, so they render in the same batch. However, the operation:

entangledLanes |= entangledLanes & DefaultLane;

is effectively a no-op and doesn't change entangledLanes. This means that DefaultLane is not being properly entangled as intended.

@Acabbage Acabbage added the Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug label Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug
Projects
None yet
Development

No branches or pull requests

1 participant