-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Updating check to only set status as online if we're sure we're online #38409
Conversation
…se so we don't schedule several reconnects
No need for a C+ review on this one. |
Reviewer Checklist
Screenshots/VideosStraight forward logic change Android: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
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!
@@ -62,7 +62,7 @@ Onyx.connect({ | |||
setOfflineStatus(true); | |||
} else { | |||
// If we are no longer forcing offline fetch the NetInfo to set isOffline appropriately | |||
NetInfo.fetch().then((state) => setOfflineStatus(state.isInternetReachable === false)); | |||
NetInfo.fetch().then((state) => setOfflineStatus((state.isInternetReachable ?? false) === false)); |
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.
alternatively we could do this I assume, but either works
NetInfo.fetch().then((state) => setOfflineStatus((state.isInternetReachable ?? false) === false)); | |
NetInfo.fetch().then((state) => setOfflineStatus(state.isInternetReachable !== true)); |
🚀 Deployed to staging by https://github.com/mountiny in version: 1.4.54-0 🚀
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 1.4.54-4 🚀
|
Details
Since
isInternetReachable
can be returned asnull
if current state is unknown, we're considering that as if we're online. Through the logs, it was possible to check that this triggers several ReconnectApps/ReconnectToReport while the app is still trying to understand if it's online or not. Let's explicitly say that we're not online until we have a state saying otherwise.Log 1 and Log 2 - search for
Firing reconnection callbacks because
. You'll see that the line just before it hasisInternetReachable: ''
, so the device was not connected to the internet when we scheduled a ReconnectApp request. That is happening for all requests that we call once we are reconnect.Fixed Issues
$ #38160
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