Skip to content

Conversation

jodarove
Copy link
Contributor

@jodarove jodarove commented Jun 25, 2020

Details

When vnodes are allocated in slots (synthetic-shadow only), the process rewrites the vnode key, in the case of text vnodes (they don't have key), it will make 2 different text vnodes in the same slot, to have the same key.

Later on in this section diffing algo, createKeyToOldIdx will map incorrectly those 2 nodes, causing the algo to patch the incorrect vnode, which eventually triggers an error.

This PR fixes the issue by not adding the slot key for text nodes.

Does this PR introduce breaking changes?

  • No, it does not introduce breaking changes.

GUS item

W-7292159

Copy link
Member

@ekashida ekashida left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this solution better, especially since the lack of keys on text vnodes doesn't seem to have much overall impact.

Copy link
Member

@pmdartus pmdartus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR looks way better! 👏

@jodarove jodarove removed the nomerge label Jun 25, 2020
@jodarove jodarove merged commit 9746b87 into master Jun 25, 2020
@jodarove jodarove deleted the jodarove/fix-diffing-algo-with-text-2 branch June 25, 2020 16:47
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

Successfully merging this pull request may close these issues.

3 participants