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

Suppress error notifications for failures of convenience operations resulting from lack of Internet access #1429

Open
3 tasks done
per1234 opened this issue Sep 13, 2022 · 6 comments
Assignees
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement

Comments

@per1234
Copy link
Contributor

per1234 commented Sep 13, 2022

Describe the request

Do not show error notifications for failures of automated non-essential operations due to lack of Internet access.

Lack of Internet access should only be considered an error condition when it causes the failure of an operation that falls under one of the following categories:

  • Essential to core functionality of Arduino IDE (e.g., download of serial-discovery tool on first run)
  • User triggered action (e.g., installing a library via Library Manager)

🙂 User will not be bothered by the appearance of unnecessary error notifications.

Describe the current behavior

Users won't necessarily have Internet access on every single startup of the IDE. Although the IDE's functionality is enhanced by the ability to access resources from the Internet, the core functionality of sketch development does not have a reliance on an Internet connection. So Internet access is not considered a prerequisite for ongoing usage of the IDE.

On every startup, the IDE reads some information from the Internet. On the first run, this includes some essential files, and communicating to the user when these could not be downloaded is important (#784). However, on all other runs the information accessed is only for non-essential features:

  • Update the indexes used by Boards Manager and Library Manager.
  • Check if there is a newer version of the Arduino IDE available.

Multiple prominent error notifications are shown on every startup when these operations fail due to lack of Internet access.

image

🙁 The cryptic index download error might give users might the impression that something is wrong with the IDE.

🙁 Users might be given the impression that the IDE can only be used while connected to the Internet.

Arduino IDE version

2.0.0-rc9.4

Operating system

Windows

Operating system version

10

Additional context

For the sake of searchability, I'll add the text of the notifications:

Error downloading index 'https://downloads.arduino.cc/packages/package_index.tar.bz2': Get "https://downloads.arduino.cc/packages/package_index.tar.bz2": dial tcp: lookup downloads.arduino.cc: no such host
Error while checking for Arduino IDE updates. Request checkForUpdates failed with message: net::ERR_NAME_NOT_RESOLVED
Error while checking for Arduino IDE updates. Request checkForUpdates failed with message: net::ERR_INTERNET_DISCONNECTED

Issue checklist

  • I searched for previous requests in the issue tracker
  • I verified the feature was still missing when using the latest nightly build
  • My request contains all necessary details
@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Sep 13, 2022
@Franck78

This comment was marked as off-topic.

@kittaakos
Copy link
Contributor

kittaakos commented Sep 29, 2022

@AlbyIanna, do you have any objections if I take over this task? It's very much connected with #1438. Thanks!

Update: leave the assignments as-is.

@kittaakos
Copy link
Contributor

Easier if IDE2 runs the update checks only if navigator.onLine. Otherwise, it doesn't. No error handling would be required.

IDE2 already warns the users if there is no Internet connection.

Screen Shot 2022-09-29 at 17 59 45

return window.navigator.onLine ? 'connected' : 'offline';

@AlbyIanna
Copy link
Contributor

@kittaakos unfortunately using navigator.onLine is not a safe indicator as it can result in false positives:

Since many cases return true, you should treat with care situations of getting false positives, as we cannot always assume that true value means that Electron can access the Internet. For example, in cases when the computer is running a virtualization software that has virtual Ethernet adapters in "always connected" state. Therefore, if you want to determine the Internet access status of Electron, you should develop additional means for this check.

Then I believe we should handle those errors somehow. It would also be nice to change those two lines to use a more reliable way of checking the internet connection, but I guess we can handle that separately.

@kittaakos
Copy link
Contributor

unfortunately using navigator.onLine is not a safe indicator as it can result in false positives:

Thanks for the link. What about trying is-reachable or is-online? I am sure a lib with 100k downloads per week will perform better than anything we do in-house.

@AlbyIanna
Copy link
Contributor

Thank you, I will do some tests with those packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

No branches or pull requests

4 participants