Skip to content

[NetworkReporter][Android] Support redirects in InspectorNetworkReporter - #60239

Merged
huntie merged 1 commit into
mainfrom
pr60239
Nov 26, 2026
Merged

huntie merged 1 commit into
mainfrom
pr60239

Conversation

@huntie

@huntie huntie commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Summary

Context

Expo is moving expo/fetch, expo-image and expo-asset onto RCTInspectorNetworkReporter and InspectorNetworkReporter, in place of its own CDP relay in Expo CLI. This stack fills the gaps in those APIs for networking stacks that replace RCTNetworking and NetworkingModule.

This diff

Support reporting redirects from InspectorNetworkReporter, the Android counterpart to #60237. The JNI binding always passes std::nullopt for the redirect response, so a redirected request shows in the Network panel as one request.

  • Add a reportRequestStart overload taking the redirect response's URL, status and headers. Expo reports each hop with it from an OkHttp network interceptor.
  • Share the request conversion between the two JNI methods.

Changelog:
[Android][Added] - React Native DevTools: InspectorNetworkReporter.reportRequestStart overload to report redirects, for networking stacks that replace NetworkingModule

Test Plan

  • ✅ ./gradlew :packages:react-native:ReactAndroid:compileDebugKotlin, and javap -s shows the overload's JVM descriptor, which matches the one fbjni derives from the new JNI method's signature:
(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;Ljava/lang/String;JLjava/lang/String;ILjava/util/Map;)V
  • ✅ Compiled JInspectorNetworkReporter.cpp for arm64-v8a with the NDK, with and without REACT_NATIVE_DEBUGGER_ENABLED.
  • ℹ️ Added the JNI method to the four ReactAndroid C++ API snapshots by hand; yarn cxx-api-build fails locally for the Android views on an unrelated Doxygen parse error in fmt's headers.
  • Not run on a device: the overload has no caller in React Native itself.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 23, 2026
@facebook-github-tools facebook-github-tools Bot added p: Expo Partner: Expo Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Nov 23, 2026
@huntie
huntie changed the base branch from main to pr60236 November 24, 2026 12:56
@huntie
huntie added this pull request to stack #60262 November 24, 2026 12:57
Base automatically changed from pr60236 to main November 24, 2026 16:29

@gabrieldonadel gabrieldonadel left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just one non-blocker question

@github-actions github-actions Bot added the Meta Review Required This PR is considered risky and requires Meta to import it to do more testing before merging. label Nov 26, 2026
@huntie
huntie merged commit 26b4897 into main Nov 26, 2026
59 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Meta Review Required This PR is considered risky and requires Meta to import it to do more testing before merging. p: Expo Partner: Expo Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants