Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
InspectorNetworkReporterhas no way to report a redirect.NetworkReporter::reportRequestStartalready takes an optional redirect response, which it sends asNetwork.requestWillBeSent'sredirectResponse, but the JNI binding always passesstd::nullopt. Networking stacks that report through it in place ofNetworkingModuleshow a redirected request in the Network panel as one request, with the original URL and the final response.This is the Android counterpart to #60237.
Motivation
Expo is moving
expo/fetch,expo-imageandexpo-assetontoInspectorNetworkReporter, in place of its own CDP relay in Expo CLI, which reports each redirect hop. An OkHttp network interceptor sees each hop, and reports it with this method.Changes
reportRequestStartoverload taking the redirect response's URL, status and headers, which reports a request sent after a redirect under the same request id.Changelog:
[Android][Added] - React Native DevTools:
InspectorNetworkReporter.reportRequestStartoverload to report redirects, for networking stacks that replaceNetworkingModuleTest Plan
./gradlew :packages:react-native:ReactAndroid:compileDebugKotlin, andjavap -sshows the overload's JVM descriptor, which matches the onefbjniderives from the new JNI method's signature:JInspectorNetworkReporter.cppfor arm64-v8a with the NDK, with and withoutREACT_NATIVE_DEBUGGER_ENABLED.ReactAndroidC++ API snapshots by hand;yarn cxx-api-buildfails locally for the Android views on an unrelated Doxygen parse error infmt's headers.