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
This commit is contained in:
Joshua Gross
2021-03-29 20:29:36 -07:00
committed by Facebook GitHub Bot
parent d1f09f7390
commit 2aee39cdc1
@@ -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);