-
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
Add logs for backend reachability and SequentialQueue #43227
Add logs for backend reachability and SequentialQueue #43227
Conversation
src/libs/NetworkConnection.ts
Outdated
return; | ||
} | ||
checkInternetReachability().then((isInternetReachable: boolean) => { | ||
setOfflineStatus(!isInternetReachable); | ||
setNetWorkStatus(isInternetReachable); | ||
NetworkActions.setIsBackendReachable(false); | ||
NetworkActions.setIsBackendReachable(false, 'request succeeded, but internet reachability test failed'); |
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.
This doesn't have anything to do with the reachability test, so I think it should be moved outside the promise (same as below). I think the intention is to always set it to false if the ping fails for any reason, but that doesn't mean the internet is reachable or not.
src/libs/Network/SequentialQueue.ts
Outdated
return; | ||
} | ||
|
||
if (isSequentialQueueRunning || PersistedRequests.getAll().length === 0) { | ||
if (PersistedRequests.getAll().length === 0) { | ||
console.debug('[SequentialQueue] Unable to flush. No requests to process.'); |
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'd be game to changing all of these to Log.info()
. It would have been really helpful for debugging Doza's case where we had to look at logs from the previous day.
|
||
function setIsBackendReachable(isBackendReachable: boolean) { | ||
function setIsBackendReachable(isBackendReachable: boolean, reason: string) { | ||
if (isBackendReachable) { |
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.
It would be great to add this same log for setIsOffline()
below.
Ah shucks, I tried to get this one done today, but heading OOO now. Please feel free to take over @tgolen |
OK, will do! |
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/tgolen in version: 1.4.82-0 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.4.82-4 🚀
|
This PR just adds a bunch of logs to help debug what's happening with the network connection and the sequential queue.
Note
This change is platform independent so I'm only testing it and providing screenshots for web
Details
Fixed Issues
Part of #43253 (linking like this since this PR doesn't explicitly fix the issue, only helps triage it
Tests
[info] [Network]
Offline tests
Included above
QA Steps
Same as the above
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