Skip to content

Conversation

@pFornagiel
Copy link
Contributor

Description

This PR introduces additional check for React Native 0.83.0 running on an Android device, which helps to disable native network inspector in this case.

When using native network inspector implementation with Android device on version 0.83.0, the Size of request made to an https endpoint is always -1. This behaviour is caused by React Native DevTools bug and is not our fault (it is in fact also apparent in the devtools window itself), but given that our implementation works in this case, we should switch to it to provide proper user experience when we can.

image

This change required moving the compatibility check from ApplicationContext to ApplicationSession, as we do not have information about used device in the LaunchConfig (it is tailored for both platforms, the platform information itself comes at later initialisation stage).

How Has This Been Tested:

Verified that, on version 0.83.0 native network inspector is used on iOS and disabled on android, switched to other version (0.82.0), then back to 0.83.0 to check whether the version updates correctly.

Changed package.json of react-native to state that version is 0.83.2 and checked that in this case, android properly uses the native implementation.

Checked that explicitly toggling the option useNativeInspectorImplementation in launch configuration works as expected.

How Has This Change Been Documented:

Not Applicable.

@pFornagiel pFornagiel requested a review from jwajgelt December 12, 2025 10:52
@vercel
Copy link

vercel bot commented Dec 12, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
radon-ide Ready Ready Preview Comment Dec 12, 2025 10:52am

@pFornagiel
Copy link
Contributor Author

@filip131311
If accepted, also candidate for 1.14.1

Comment on lines +320 to +345
private shouldEnableNativeNetworkInspector(): boolean {
const launchConfig = this.applicationContext.launchConfig;
const useNativeNetworkInspectorFlag = launchConfig.useNativeNetworkInspector;

const explicitlyEnabled = useNativeNetworkInspectorFlag === true;
const explicitlyDisabled = useNativeNetworkInspectorFlag === false;

if (explicitlyEnabled) {
return true;
}
if (explicitlyDisabled) {
return false;
}

const reactNativeVersion = this.applicationContext.reactNativeVersion;
const meetsMinimumVersion = (reactNativeVersion?.compare("0.83.0") ?? -1) >= 0;
const isAndroid = this.device.platform === DevicePlatform.Android;
const isAndroid0830 = reactNativeVersion?.compare("0.83.0") === 0 && isAndroid;

// RN 0.83.0 on Android has known issues with native network inspector
if (isAndroid0830) {
return false;
}

return meetsMinimumVersion;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't like this, but I don't have a better idea.

@pFornagiel pFornagiel merged commit 248edc6 into main Dec 12, 2025
9 checks passed
@pFornagiel pFornagiel deleted the @pFornagiel/network-0.83-android-fix branch December 12, 2025 12:56
jwajgelt pushed a commit that referenced this pull request Dec 12, 2025
…3.0 due to issues (#1816)

### Description

This PR introduces additional check for React Native `0.83.0` running on
an Android device, which helps to disable native network inspector in
this case.

When using native network inspector implementation with Android device
on version `0.83.0`, the `Size` of request made to an `https` endpoint
is always `-1`. This behaviour is caused by React Native DevTools bug
and is not our fault (it is in fact also apparent in the devtools window
itself), but given that our implementation works in this case, we should
switch to it to provide proper user experience when we can.


<img width="1190" height="356" alt="image"
src="https://github.com/user-attachments/assets/12bbf342-fb2f-4b9f-be2e-2f0618efd54d"
/>

This change required moving the compatibility check from
`ApplicationContext` to `ApplicationSession`, as we do not have
information about used device in the LaunchConfig (it is tailored for
both platforms, the platform information itself comes at later
initialisation stage).

### How Has This Been Tested: 

Verified that, on version `0.83.0` native network inspector is used on
iOS and disabled on android, switched to other version (`0.82.0`), then
back to `0.83.0` to check whether the version updates correctly.

Changed `package.json` of react-native to state that version is `0.83.2`
and checked that in this case, android properly uses the native
implementation.

Checked that explicitly toggling the option
`useNativeInspectorImplementation` in launch configuration works as
expected.

### How Has This Change Been Documented:

Not Applicable.
pFornagiel added a commit that referenced this pull request Dec 19, 2025
)

### Description

This PR is a follow-up to the issue tackled in
#1816

It changes additional check for React Native 0.83.0 running on an
Android device and now, instead of just checking whether it is 0.83.0,
it disables the native network inspector implementation for Android for
every version, as `0.83.1` is also broken and it is suspected that the
future versions may also be effected by the issue mentioned earlier.

The only notable change is just the predicate in `ApplicationSession`
which now checks for android and not specific version of android.


### How Has This Been Tested: 

Verified that, on version 0.83.0 and 0.83.1 native network inspector is
used on iOS and disabled on android.

### How Has This Change Been Documented:

Not applicable.
filip131311 pushed a commit that referenced this pull request Dec 23, 2025
)

### Description

This PR is a follow-up to the issue tackled in
#1816

It changes additional check for React Native 0.83.0 running on an
Android device and now, instead of just checking whether it is 0.83.0,
it disables the native network inspector implementation for Android for
every version, as `0.83.1` is also broken and it is suspected that the
future versions may also be effected by the issue mentioned earlier.

The only notable change is just the predicate in `ApplicationSession`
which now checks for android and not specific version of android.


### How Has This Been Tested: 

Verified that, on version 0.83.0 and 0.83.1 native network inspector is
used on iOS and disabled on android.

### How Has This Change Been Documented:

Not applicable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants