From 04da3d784b4d8bb3dacff0dbf6410d9a8114a9f5 Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Thu, 26 Sep 2024 11:32:00 -0700 Subject: [PATCH] Error in reportMount when surface is not found (#46678) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/46678 I'm investigating some issues with surface management and noticed `surfaceHandlerRegistry_` is not updated in the bridgeless path when using ReactSurfaceView. Adding a warning to help us validate this is resolved when we do eventually fix it. Changelog: [Internal] Reviewed By: fabriziocucci Differential Revision: D63463521 fbshipit-source-id: 38995924588f1d71b9fc517c76a6e0c572fd0699 --- .../ReactAndroid/src/main/jni/react/fabric/Binding.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/fabric/Binding.cpp b/packages/react-native/ReactAndroid/src/main/jni/react/fabric/Binding.cpp index b3915ff3afe..6cb64b8049a 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/fabric/Binding.cpp +++ b/packages/react-native/ReactAndroid/src/main/jni/react/fabric/Binding.cpp @@ -109,11 +109,13 @@ void Binding::reportMount(SurfaceId surfaceId) { // incorrectly. This is due to the push model used on Android and can be // removed when we migrate to a pull model. std::shared_lock lock(surfaceHandlerRegistryMutex_); - auto iterator = surfaceHandlerRegistry_.find(surfaceId); if (iterator != surfaceHandlerRegistry_.end()) { auto& surfaceHandler = iterator->second; surfaceHandler.getMountingCoordinator()->didPerformAsyncTransactions(); + } else { + LOG(ERROR) << "Binding::reportMount: Surface with id " << surfaceId + << " is not found"; } }