Fix network connection multiple reachablity request#44901
Fix network connection multiple reachablity request#44901srikarparsi merged 1 commit intoExpensify:mainfrom
Conversation
|
@hayata-suenaga Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
I can take this @hayata-suenaga, assigned to the associated issue |
|
Hi @OlimpiaZurek! Do you think you could add tests similar to this issue to make sure everything still works? |
|
@srikarparsi I added test steps to the description. |
|
@rushatgabhane can you help move this one along? |
|
might be a dumb question. do patches not require any changes in package.json? |
rushatgabhane
left a comment
There was a problem hiding this comment.
@OlimpiaZurek im not sure if this is fixing the issue. The ping command is being made constantly. That is what we're attempting to fix, right?
- Go offline
- Navigate to a different report
Screen.Recording.2024-07-11.at.02.31.47.mov
no additional changes to package.json are required if you we simply updating an existing patch |
|
thank you! @OlimpiaZurek what are your thoughts on #44901 (review) |
|
@rushatgabhane The purpose of this fix is to prevent excessive Ping and Reconnect commands when there is a poor internet connection. More details can be found here.. This issue is challenging to reproduce, but our investigation revealed that it might be caused by the NetInfo library sending multiple reachability requests in parallel. So, we fixed it and patched this fix to the The behavior in the attached video works as expected. The check for internet reachability should occur every 5 seconds when the internet was not previously detected (offline mode). |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-07-11.at.16.mp4Android: mWeb ChromeiOS: NativeScreen.Recording.2024-07-11.at.16.mp4iOS: mWeb SafariScreen.Recording.2024-07-11.at.16.18.30.movMacOS: Chrome / SafariScreen.Recording.2024-07-11.at.02.31.47.movMacOS: DesktopScreen.Recording.2024-07-11.at.16.25.59.mov |
|
Let's make sure to test this on staging as well thoroughly |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
| + readonly eventEmitter: NativeEventEmitter; | ||
| }; | ||
| export default _default; | ||
| diff --git a/node_modules/@react-native-community/netinfo/package.json b/node_modules/@react-native-community/netinfo/package.json |
There was a problem hiding this comment.
Hey @OlimpiaZurek what is the reason for this change? codegen config is necessary for newArch builds
There was a problem hiding this comment.
@MrRefactor This change was applied automatically when patching the netinfo library using the patch-package. I checked and it looks like netinfo supports new arch, so it should work for newArch builds.
There was a problem hiding this comment.
based on this PR react-native-netinfo/react-native-netinfo#655 that change is necessary, for me without that change, 0.74 builds are failing
There was a problem hiding this comment.
Got it. I will prepare a PR to revert this change.
|
🚀 Deployed to staging by https://github.com/srikarparsi in version: 9.0.7-3 🚀
|
|
🚀 Cherry-picked to staging by https://github.com/thienlnam in version: 9.0.7-4 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
|
🚀 Deployed to production by https://github.com/thienlnam in version: 9.0.7-8 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.0.8-6 🚀
|
Details
This PR changes the network connection logic to remove the
hasPendingNetworkCheckflag, delegating its responsibility to the NetInfo library.The goal is to simplify the code and rely on the library's internal mechanisms for managing pending network checks.
Fixed Issues
$ #44269
PROPOSAL:
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop