Fix case where absolute nodes would sometimes not be cloned #1675

Closed
joevilches wants to merge 1 commits from export-D59175629 into main
joevilches commented 2024-07-01 17:57:25 -07:00 (Migrated from github.com)

Summary:
There was a bug where some crash would happen if a tree was cloned that had static/absolute parent/child pair inside it. This was because we were no longer calling cloneChildrenIfNeeded on the static parent, but would still layout the absolute child. So that child's owner would be stale and have new layout. In React Native this would lead to a failed assert which causes the crash.

The fix here is to clone the children of static nodes during layoutAbsoluteDescendants so that we guarantee the node is either cloned if it is going to have new layout.

Differential Revision: D59175629

Summary: There was a bug where some crash would happen if a tree was cloned that had static/absolute parent/child pair inside it. This was because we were no longer calling `cloneChildrenIfNeeded` on the static parent, but would still layout the absolute child. So that child's owner would be stale and have new layout. In React Native this would lead to a failed assert which causes the crash. The fix here is to clone the children of static nodes during `layoutAbsoluteDescendants` so that we guarantee the node is either cloned if it is going to have new layout. Differential Revision: D59175629
vercel[bot] commented 2024-07-01 17:57:28 -07:00 (Migrated from github.com)

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
yoga-website Ready (Inspect) Visit Preview 💬 Add feedback Jul 2, 2024 6:17pm
[vc]: #ykh2zhvwCQyCT/wFMVDfBkHgQQ2L0XUXYRoTNzPesiU=:eyJpc01vbm9yZXBvIjp0cnVlLCJ0eXBlIjoiZ2l0aHViIiwicHJvamVjdHMiOlt7Im5hbWUiOiJ5b2dhLXdlYnNpdGUiLCJyb290RGlyZWN0b3J5Ijoid2Vic2l0ZSIsImluc3BlY3RvclVybCI6Imh0dHBzOi8vdmVyY2VsLmNvbS9mYm9wZW5zb3VyY2UveW9nYS13ZWJzaXRlLzNqd0oyTTMyZEFmR0R4amJIdzltMjlqeW0zV24iLCJwcmV2aWV3VXJsIjoieW9nYS13ZWJzaXRlLWdpdC1mb3JrLWpvZXZpbGNoZXMtZXhwb3J0LWQ1OTE3NTYyOS1mYm9wZW5zb3VyY2UudmVyY2VsLmFwcCIsIm5leHRDb21taXRTdGF0dXMiOiJERVBMT1lFRCIsImxpdmVGZWVkYmFjayI6eyJyZXNvbHZlZCI6MCwidW5yZXNvbHZlZCI6MCwidG90YWwiOjAsImxpbmsiOiJ5b2dhLXdlYnNpdGUtZ2l0LWZvcmstam9ldmlsY2hlcy1leHBvcnQtZDU5MTc1NjI5LWZib3BlbnNvdXJjZS52ZXJjZWwuYXBwIn19XX0= **The latest updates on your projects**. Learn more about [Vercel for Git ↗︎](https://vercel.link/github-learn-more) | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **yoga-website** | ✅ Ready ([Inspect](https://vercel.com/fbopensource/yoga-website/3jwJ2M32dAfGDxjbHw9m29jym3Wn)) | [Visit Preview](https://vercel.live/open-feedback/yoga-website-git-fork-joevilches-export-d59175629-fbopensource.vercel.app?via=pr-comment-visit-preview-link&passThrough=1) | 💬 [**Add feedback**](https://vercel.live/open-feedback/yoga-website-git-fork-joevilches-export-d59175629-fbopensource.vercel.app?via=pr-comment-feedback-link) | Jul 2, 2024 6:17pm |
facebook-github-bot commented 2024-07-01 17:57:47 -07:00 (Migrated from github.com)

This pull request was exported from Phabricator. Differential Revision: D59175629

This pull request was **exported** from Phabricator. Differential Revision: [D59175629](https://www.internalfb.com/diff/D59175629)
facebook-github-bot commented 2024-07-02 11:14:25 -07:00 (Migrated from github.com)

This pull request was exported from Phabricator. Differential Revision: D59175629

This pull request was **exported** from Phabricator. Differential Revision: [D59175629](https://www.internalfb.com/diff/D59175629)
facebook-github-bot commented 2024-07-02 15:18:03 -07:00 (Migrated from github.com)

This pull request has been merged in facebook/yoga@a1e9abb9b3.

This pull request has been merged in facebook/yoga@a1e9abb9b387caa4fa26d0803b5b1b531d4135a4.

Pull request closed

Sign in to join this conversation.
No description provided.