Skip to content
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

feat: status check for internet connection #552

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

swarnimarun
Copy link
Contributor

Currently the code is ready for merge, we need to decide what and how should we handle tracking internet connection updates.

The approach I have implemented below is,

  • Every 60 seconds make a network request to verify if we still have a live internet connection.
  • Send event about the status after the request verifies the status to JS.
  • Hold a receiver on Rust end that can also handle certain actions if internet status changes (reconnecting to prem network, etc).

Open Questions that need discussion:

  • Whom and how should we make net requests. Eg,
    • Make ICMP request to say 8.8.8.8 to verify internet is available.
    • Make TCP/HTTP request to some always available website like google or etc to verify network connectivity.
    • Make HTTP request to registry to verify internet connectivity.

The advantages of the first is that it's cheap and we can ping dozens of servers as once, to ensure we have little to no false positive. But ICMP doesn't represent that webservers are also working, and in certain cases it may not reflect the applications ability to connect to internet.

The advantages of the second is even though it's heavier but we can in general verify that internet over TCP/HTTP is definitely available but will have the risk of not representing availability of registries.

The advantages third is it's very accurate, but it's also comes with the risk of causing rate limiting over registries or over burdening the registries(imagine if someone adds their own registries without realizing they might be bombarded by requests just for connectivity check).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant