-
Notifications
You must be signed in to change notification settings - Fork 24.8k
Add featureflag to not re-order mount items in FabricMountingManager #46702
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
Conversation
This pull request was exported from Phabricator. Differential Revision: D63148523 |
…acebook#46702) Summary: In facebook#44188, we've started combining multiple transactions in a single transaction, to meet React's atomicity requirements, while also dealing with the constraints of Android's Fabric implementation. This revealed a bug where in some scenarios (especially when using transitions), a node may be deleted and created during the same transaction. The current implementation of FabricMountingManager assumes it can safely reorder some operations, which it does to optimize the size of IntBufferBatch mount items. This is however incorrect and unsafe when multiple transactions are merged. **Example:** Differentiator output: ``` # Transaction 1 Remove facebook#100 from facebook#11 Delete facebook#100 # Transaction 2 Create facebook#100 Insert facebook#100 into facebook#11 ``` FabricMountingManager output ``` Remove facebook#100 from facebook#11 Insert facebook#100 into facebook#11 Delete facebook#100 ``` Note that the create action is also skipped, because we only update `allocatedViewTags` after processing all mutations, leading FabricMountingManager to assume creation is not required. This leads to an invalid state in SurfaceMountingManager, which will be surfaced as a crash in `getViewState` on the next mutation that interacts with these views. Changelog: [Android][Fixed] Fix crash in getViewState when using suspense fallbacks. Differential Revision: D63148523
6e3d15f
to
c4f235e
Compare
This pull request was exported from Phabricator. Differential Revision: D63148523 |
…acebook#46702) Summary: Pull Request resolved: facebook#46702 In facebook#44188, we've started combining multiple transactions in a single transaction, to meet React's atomicity requirements, while also dealing with the constraints of Android's Fabric implementation. This revealed a bug where in some scenarios (especially when using transitions), a node may be deleted and created during the same transaction. The current implementation of FabricMountingManager assumes it can safely reorder some operations, which it does to optimize the size of IntBufferBatch mount items. This is however incorrect and unsafe when multiple transactions are merged. **Example:** Differentiator output: ``` # Transaction 1 Remove facebook#100 from facebook#11 Delete facebook#100 # Transaction 2 Create facebook#100 Insert facebook#100 into facebook#11 ``` FabricMountingManager output ``` Remove facebook#100 from facebook#11 Insert facebook#100 into facebook#11 Delete facebook#100 ``` Note that the create action is also skipped, because we only update `allocatedViewTags` after processing all mutations, leading FabricMountingManager to assume creation is not required. This leads to an invalid state in SurfaceMountingManager, which will be surfaced as a crash in `getViewState` on the next mutation that interacts with these views. Changelog: [Android][Fixed] Fix crash in getViewState when using suspense fallbacks. Reviewed By: sammy-SC Differential Revision: D63148523
This pull request was exported from Phabricator. Differential Revision: D63148523 |
c4f235e
to
bc986d0
Compare
This pull request has been merged in bd133b5. |
This pull request was successfully merged by @javache in bd133b5 When will my fix make it into a release? | How to file a pick request? |
Summary: We previously fixed Differentiator generating an incorrect parentTag (facebook#48055), but this can lead to crashes in Android UI due to reordering that happens in the Android mounting layer. While we have an experiment to disable this reordering (facebook#46702) this currently has a negative performance impact which needs to be addressed. As a mitigation, we can make the lookup of parentTag's ViewManager state nullable. We only require this to support `needsCustomLayoutForChildren`, which is not commonly used, and seems acceptable to drop in this scenario. Changelog: [Android][Changed] Do not crash when parent view state can't be found Differential Revision: D70966621
Summary: We previously fixed Differentiator generating an incorrect parentTag (facebook#48055), but this can lead to crashes in Android UI due to reordering that happens in the Android mounting layer. While we have an experiment to disable this reordering (facebook#46702) this currently has a negative performance impact which needs to be addressed. As a mitigation, we can make the lookup of parentTag's ViewManager state nullable. We only require this to support `needsCustomLayoutForChildren`, which is not commonly used, and seems acceptable to drop in this scenario. Changelog: [Android][Changed] Do not crash when parent view state can't be found Differential Revision: D70966621
Summary: Pull Request resolved: #49951 We previously fixed Differentiator generating an incorrect parentTag (#48055), but this can lead to crashes in Android UI due to reordering that happens in the Android mounting layer. While we have an experiment to disable this reordering (#46702) this currently has a negative performance impact which needs to be addressed. As a mitigation, we can make the lookup of parentTag's ViewManager state nullable. We only require this to support `needsCustomLayoutForChildren`, which is not commonly used, and seems acceptable to drop in this scenario. Changelog: [Android][Changed] Do not crash when parent view state can't be found Reviewed By: NickGerleman Differential Revision: D70966621 fbshipit-source-id: 33d0b6a90860788a4c9a8c6cea36c2c72c1392e1
…#49951) Summary: Pull Request resolved: facebook#49951 We previously fixed Differentiator generating an incorrect parentTag (facebook#48055), but this can lead to crashes in Android UI due to reordering that happens in the Android mounting layer. While we have an experiment to disable this reordering (facebook#46702) this currently has a negative performance impact which needs to be addressed. As a mitigation, we can make the lookup of parentTag's ViewManager state nullable. We only require this to support `needsCustomLayoutForChildren`, which is not commonly used, and seems acceptable to drop in this scenario. Changelog: [Android][Changed] Do not crash when parent view state can't be found Reviewed By: NickGerleman Differential Revision: D70966621 fbshipit-source-id: 33d0b6a90860788a4c9a8c6cea36c2c72c1392e1
…#49951) Summary: Pull Request resolved: facebook#49951 We previously fixed Differentiator generating an incorrect parentTag (facebook#48055), but this can lead to crashes in Android UI due to reordering that happens in the Android mounting layer. While we have an experiment to disable this reordering (facebook#46702) this currently has a negative performance impact which needs to be addressed. As a mitigation, we can make the lookup of parentTag's ViewManager state nullable. We only require this to support `needsCustomLayoutForChildren`, which is not commonly used, and seems acceptable to drop in this scenario. Changelog: [Android][Changed] Do not crash when parent view state can't be found Reviewed By: NickGerleman Differential Revision: D70966621 fbshipit-source-id: 33d0b6a90860788a4c9a8c6cea36c2c72c1392e1
Summary:
In #44188, we've started combining multiple transactions in a single transaction, to meet React's atomicity requirements, while also dealing with the constraints of Android's Fabric implementation.
This revealed a bug where in some scenarios (especially when using transitions), a node may be deleted and created during the same transaction. The current implementation of FabricMountingManager assumes it can safely reorder some operations, which it does to optimize the size of IntBufferBatch mount items. This is however incorrect and unsafe when multiple transactions are merged.
Example:
Differentiator output:
FabricMountingManager output
Note that the create action is also skipped, because we only update
allocatedViewTags
after processing all mutations, leading FabricMountingManager to assume creation is not required.This leads to an invalid state in SurfaceMountingManager, which will be surfaced as a crash in
getViewState
on the next mutation that interacts with these views.Changelog: [Android][Fixed] Fix crash in getViewState when using suspense fallbacks.
Differential Revision: D63148523