-
Notifications
You must be signed in to change notification settings - Fork 81
fix: network inspector - disable native implementation on android 0.83.0 due to issues #1816
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Author
|
@filip131311 |
jwajgelt
approved these changes
Dec 12, 2025
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; | ||
| } |
Contributor
There was a problem hiding this comment.
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.
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
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.
Description
This PR introduces additional check for React Native
0.83.0running 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, theSizeof request made to anhttpsendpoint 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.This change required moving the compatibility check from
ApplicationContexttoApplicationSession, 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.0native network inspector is used on iOS and disabled on android, switched to other version (0.82.0), then back to0.83.0to check whether the version updates correctly.Changed
package.jsonof react-native to state that version is0.83.2and checked that in this case, android properly uses the native implementation.Checked that explicitly toggling the option
useNativeInspectorImplementationin launch configuration works as expected.How Has This Change Been Documented:
Not Applicable.