Fix Android crash: mark re-created nodes in Differ

Summary:
Android has some optimizations around view allocation and pre-allocation that, in the case of View Unflattening, can cause "Create" mutations to be skipped.

To make sure that doesn't happen, we add a flag to ShadowViewMutation (in the core) that any platform can consume, that indicates if the mutation is a "recreation" mutation.

It is still a bit unclear why this is needed, in the sense that I would expect props revision to increment if a view is unflattened. However, there is at least one documented reproduction where that is *not* the case. So for now, we'll have a hack pending further investigation.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D25935785

fbshipit-source-id: 6fb4f0a6dedba0fe46ba3cd558ac1daa70f671f5
This commit is contained in:
Joshua Gross
2021-01-16 11:05:54 -08:00
committed by Facebook GitHub Bot
parent a0403c0626
commit bdea479a1f
4 changed files with 15 additions and 8 deletions
@@ -553,7 +553,7 @@ void Binding::schedulerDidFinishTransaction(
switch (mutationType) {
case ShadowViewMutation::Create: {
if (disablePreallocateViews_ ||
newChildShadowView.props->revision > 1) {
newChildShadowView.props->revision > 1 || mutation.recreated) {
cppCommonMountItems.push_back(
CppMountItem::CreateMountItem(newChildShadowView));
}