Disable preallocation check on mount items

Summary:
Ensures (under a flag) that CREATE instructions will be issued even if the node was supposed to be preallocated before from create or clone. This addresses cases when differ considers nodes to be deleted->created, but we skip the "create" part because of revision check.

Changelog:
[Internal] Disable node revision checks during mount under a flag

Reviewed By: sammy-SC

Differential Revision: D32440831

fbshipit-source-id: 4da8c4961fd7bc43c8f4166798bdfb5d897184e0
This commit is contained in:
Andrei Shikov
2021-11-16 11:48:12 -08:00
committed by Facebook GitHub Bot
parent 5dcad6a116
commit 1e7da82623
@@ -708,10 +708,12 @@ void Binding::schedulerDidFinishTransaction(
bool isVirtual = mutation.mutatedViewIsVirtual();
bool noRevisionCheck =
disablePreallocateViews_ || disableRevisionCheckForPreallocation_;
switch (mutationType) {
case ShadowViewMutation::Create: {
if (disablePreallocateViews_ ||
newChildShadowView.props->revision > 1) {
if (noRevisionCheck || newChildShadowView.props->revision > 1) {
cppCommonMountItems.push_back(
CppMountItem::CreateMountItem(newChildShadowView));
}
@@ -772,8 +774,7 @@ void Binding::schedulerDidFinishTransaction(
cppCommonMountItems.push_back(CppMountItem::InsertMountItem(
parentShadowView, newChildShadowView, index));
if (disablePreallocateViews_ ||
newChildShadowView.props->revision > 1) {
if (noRevisionCheck || newChildShadowView.props->revision > 1) {
cppUpdatePropsMountItems.push_back(
CppMountItem::UpdatePropsMountItem(newChildShadowView));
}