Skip to content

Commit dd590c5

Browse files
sammy-SCfacebook-github-bot
authored andcommitted
Remove outdated asserts from StubViewTree (#51751)
Summary: Pull Request resolved: #51751 changelog: [internal] these asserts are not correct with C++ Animated or anything that overrides pull transaction. When pull transaction is overriden, the modified mounting instructions are not stored in shadow tree. Therefore, these asserts fail. Reviewed By: rshest Differential Revision: D75787083 fbshipit-source-id: ac08b96f6dea89a9f127b179a5d05e351b281c35
1 parent d0e402f commit dd590c5

1 file changed

Lines changed: 3 additions & 53 deletions

File tree

packages/react-native/ReactCommon/react/renderer/mounting/stubs/StubViewTree.cpp

Lines changed: 3 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -85,25 +85,8 @@ void StubViewTree::mutate(const ShadowViewMutationList& mutations) {
8585
auto tag = mutation.oldChildShadowView.tag;
8686
react_native_assert(hasTag(tag));
8787
auto stubView = registry_[tag];
88-
if ((ShadowView)(*stubView) != mutation.oldChildShadowView) {
89-
LOG(ERROR)
90-
<< "StubView: ASSERT FAILURE: DELETE mutation assertion failure: oldChildShadowView does not match stubView: ["
91-
<< mutation.oldChildShadowView.tag << "] stub hash: ##"
92-
<< std::hash<ShadowView>{}((ShadowView)*stubView)
93-
<< " old mutation hash: ##"
94-
<< std::hash<ShadowView>{}(mutation.oldChildShadowView);
95-
#if RN_DEBUG_STRING_CONVERTIBLE
96-
LOG(ERROR) << "StubView: "
97-
<< getDebugPropsDescription((ShadowView)*stubView, {});
98-
LOG(ERROR) << "OldChildShadowView: "
99-
<< getDebugPropsDescription(
100-
mutation.oldChildShadowView, {});
101-
#endif
102-
}
103-
react_native_assert(
104-
(ShadowView)(*stubView) == mutation.oldChildShadowView);
105-
registry_.erase(tag);
10688

89+
registry_.erase(tag);
10790
recordMutation(mutation);
10891

10992
break;
@@ -177,25 +160,8 @@ void StubViewTree::mutate(const ShadowViewMutationList& mutations) {
177160
static_cast<size_t>(mutation.index));
178161
react_native_assert(hasTag(childTag));
179162
auto childStubView = registry_[childTag];
180-
if ((ShadowView)(*childStubView) != mutation.oldChildShadowView) {
181-
LOG(ERROR)
182-
<< "StubView: ASSERT FAILURE: REMOVE mutation assertion failure: oldChildShadowView does not match oldStubView: ["
183-
<< mutation.oldChildShadowView.tag << "] stub hash: ##"
184-
<< std::hash<ShadowView>{}((ShadowView)*childStubView)
185-
<< " old mutation hash: ##"
186-
<< std::hash<ShadowView>{}(mutation.oldChildShadowView);
187-
#if RN_DEBUG_STRING_CONVERTIBLE
188-
LOG(ERROR) << "ChildStubView: "
189-
<< getDebugPropsDescription(
190-
(ShadowView)*childStubView, {});
191-
LOG(ERROR) << "OldChildShadowView: "
192-
<< getDebugPropsDescription(
193-
mutation.oldChildShadowView, {});
194-
#endif
195-
}
196-
react_native_assert(
197-
(ShadowView)(*childStubView) == mutation.oldChildShadowView);
198163
react_native_assert(childStubView->parentTag == parentTag);
164+
199165
STUB_VIEW_LOG({
200166
std::string strChildList = "";
201167
int i = 0;
@@ -245,23 +211,7 @@ void StubViewTree::mutate(const ShadowViewMutationList& mutations) {
245211
react_native_assert(hasTag(mutation.parentTag));
246212
react_native_assert(oldStubView->parentTag == mutation.parentTag);
247213
}
248-
if ((ShadowView)(*oldStubView) != mutation.oldChildShadowView) {
249-
LOG(ERROR)
250-
<< "StubView: ASSERT FAILURE: UPDATE mutation assertion failure: oldChildShadowView does not match oldStubView: ["
251-
<< mutation.oldChildShadowView.tag << "] old stub hash: ##"
252-
<< std::hash<ShadowView>{}((ShadowView)*oldStubView)
253-
<< " old mutation hash: ##"
254-
<< std::hash<ShadowView>{}(mutation.oldChildShadowView);
255-
#if RN_DEBUG_STRING_CONVERTIBLE
256-
LOG(ERROR) << "OldStubView: "
257-
<< getDebugPropsDescription((ShadowView)*oldStubView, {});
258-
LOG(ERROR) << "OldChildShadowView: "
259-
<< getDebugPropsDescription(
260-
mutation.oldChildShadowView, {});
261-
#endif
262-
}
263-
react_native_assert(
264-
(ShadowView)(*oldStubView) == mutation.oldChildShadowView);
214+
265215
oldStubView->update(mutation.newChildShadowView);
266216

267217
// Hash for stub view and the ShadowView should be identical - this

0 commit comments

Comments
 (0)