-
Notifications
You must be signed in to change notification settings - Fork 4
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
[INV-3715] Use Network to determine online status v1 #3722
Closed
Closed
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
463c0d4
Create actions/handlers to trigger API Checks for network connectivity
LocalNewsTV ad0c774
Check network status at app load
LocalNewsTV da52b2c
update NetworkActions.ts
LocalNewsTV 98a3e2f
Simplify alertsAndPrompts handling of new entries, add new Alert
LocalNewsTV 0c93e6c
Add workflows for monitoring network connections
LocalNewsTV 4844619
Add manualReconnect path, simplify the rest
LocalNewsTV cdb73f7
Cleanup unused imports
LocalNewsTV 36327e4
Move configuration yield out of while loop
LocalNewsTV File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
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.
a single do-while loop should suffice? You have about 5 attempts going on here with a delay of 5 seconds. You can increase the MAX_ATTEMPTS and remove the outer while loop or increase SECONDS_BETWEEN_ATTEMPTS.
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.
@meghna0593
the
while(true)
loop is always pinging the API to ensure continued connection unless otherwise cancelled (by a user choosing to go offline, or being disconnected and unable to reconnect)If that do-while fetch request fails and we are UNABLE to reach our API, we don't want to immediately panic, so we send a few more requests at a faster interval to see if anything will come back. If we still can't reach the API we will trigger Offline mode.
While in offline mode, we will sporadically try a few more attempts to come back online.
In the end this is just v1 functionality, it will be succeeded by WebSockets or some similar network equivalent
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.
Originally this PR was VERY different than it is now.
The previous code you reviewed still had a
handle_CHECK_MOBILE_NETWORK_STATUS
function, but the logic for it is black and white compared to the logic I explained it in call :)Sorry for any confusion !
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.
if this was intended to be on an infinite loop when
canConnect
istrue
, then do you think this could be blocking in nature? Maybe making this a background task is worth looking at? @plasticviking thoughts?