Skip to content

Commit

Permalink
Detect startSurface race-conditions and warn silently
Browse files Browse the repository at this point in the history
Summary:
Crash in debug, log a warning and continue in production.

Changelog: [Internal]

Differential Revision: D26133167

fbshipit-source-id: 60279363a3e90d592e7ddbde188c13cda89c28c6
  • Loading branch information
JoshuaGross authored and facebook-github-bot committed Jan 29, 2021
1 parent ef765d4 commit b0ec350
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,14 @@ public void run() {
return;
}

if (rootView.getId() != View.NO_ID) {
if (rootView.getId() == mSurfaceId) {
ReactSoftException.logSoftException(
TAG,
new IllegalViewOperationException(
"Race condition in addRootView detected. Trying to set an id of ["
+ mSurfaceId
+ "] on the RootView, but that id has already been set. "));
} else if (rootView.getId() != View.NO_ID) {
FLog.e(
TAG,
"Trying to add RootTag to RootView that already has a tag: existing tag: [%d] new tag: [%d]",
Expand Down

0 comments on commit b0ec350

Please sign in to comment.