From 2aee39cdc1e4d3540d60de535d3d88a995e24a9e Mon Sep 17 00:00:00 2001 From: Joshua Gross Date: Mon, 29 Mar 2021 20:27:38 -0700 Subject: [PATCH] StubViewTree: log more information before UPDATE assertion failure Summary: Log more diagnostics about this assertion failure. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D27407775 fbshipit-source-id: 7f00215b8b2c0ad7378c5671f3b503daf56b9fd2 --- ReactCommon/react/renderer/mounting/StubViewTree.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ReactCommon/react/renderer/mounting/StubViewTree.cpp b/ReactCommon/react/renderer/mounting/StubViewTree.cpp index 577e88e366b..77be82e032e 100644 --- a/ReactCommon/react/renderer/mounting/StubViewTree.cpp +++ b/ReactCommon/react/renderer/mounting/StubViewTree.cpp @@ -151,6 +151,11 @@ void StubViewTree::mutate(ShadowViewMutationList const &mutations) { registry.find(mutation.newChildShadowView.tag) != registry.end()); auto oldStubView = registry[mutation.newChildShadowView.tag]; react_native_assert(oldStubView->tag != 0); + if ((ShadowView)(*oldStubView) != mutation.oldChildShadowView) { + LOG(ERROR) + << "UPDATE mutation assertion failure: oldChildShadowView doesn't match oldStubView: [" + << mutation.oldChildShadowView.tag << "]"; + } react_native_assert( (ShadowView)(*oldStubView) == mutation.oldChildShadowView); oldStubView->update(mutation.newChildShadowView);