-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Fix network connection multiple reachablity request #44901
Fix network connection multiple reachablity request #44901
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? |
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.
@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 |
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.
LGTM
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.
lgtm
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. |
@@ -2609,32 +2619,6 @@ index 6982220..b515270 100644 | |||
+ 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @OlimpiaZurek what is the reason for this change? codegen
config is necessary for newArch builds
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.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
hasPendingNetworkCheck
flag, 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 Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop