diff --git a/packages/react-native/ReactCommon/react/networking/NetworkReporter.cpp b/packages/react-native/ReactCommon/react/networking/NetworkReporter.cpp index 71c89b58e95d..46e7677df8fb 100644 --- a/packages/react-native/ReactCommon/react/networking/NetworkReporter.cpp +++ b/packages/react-native/ReactCommon/react/networking/NetworkReporter.cpp @@ -229,7 +229,12 @@ void NetworkReporter::reportResponseEnd( void NetworkReporter::reportRequestFailed( const std::string& requestId, - bool cancelled) const { + bool cancelled) { + { + std::lock_guard lock(perfTimingsMutex_); + perfTimingsBuffer_.erase(requestId); + } + #ifdef REACT_NATIVE_DEBUGGER_ENABLED // Debugger enabled: CDP event handling jsinspector_modern::NetworkHandler::getInstance().onLoadingFailed( diff --git a/packages/react-native/ReactCommon/react/networking/NetworkReporter.h b/packages/react-native/ReactCommon/react/networking/NetworkReporter.h index 8543afd715ca..51d5d51b3e45 100644 --- a/packages/react-native/ReactCommon/react/networking/NetworkReporter.h +++ b/packages/react-native/ReactCommon/react/networking/NetworkReporter.h @@ -122,7 +122,7 @@ class NetworkReporter { * * Corresponds to `Network.loadingFailed` in CDP. */ - void reportRequestFailed(const std::string &requestId, bool cancelled) const; + void reportRequestFailed(const std::string &requestId, bool cancelled); /** * Report that a WebSocket connection is about to be created.