bpozdena / OneDriveGUI

A simple GUI for OneDrive Linux client, with multi-account support.
GNU General Public License v3.0
704 stars 33 forks source link

Checking Onedrive version from api.github.com with timeout=1 seems too harsh #172

Closed initrunlevel0 closed 3 months ago

initrunlevel0 commented 3 months ago

Describe the bug OneDriveGUI shows error "OneDrive Client not found! Please install it" when Github access slower than 1s.

To Reproduce

Hello I need to open a discussion regarding how OneDriveGUI check github for latest version of abraunegg/onedrive.

I just opened my Linux box and checking my Onedrive Documents as usual, when suddenly I realised it does not sync any new file. When I check OneDriveGUI, it shows something like "OneDrive Client not found! Please install it" even though I had make sure /usr/bin/onedrive still there exist with latest version.

Log

2024-05-28 13:00:17,863 [connectionpool.py:1019][fn=_new_conn][DEBUG] - Starting new HTTPS connection (1): api.github.com:443
2024-05-28 13:00:18,880 [onedrivegui:2436][fn=client_version_check][ERROR] - Client version check failed: HTTPSConnectionPool(host='api.github.com', port=443): Max retries exceeded with url: /repos/abraunegg/onedrive/releases/latest (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7f5898dba150>, 'Connection to api.github.com timed out. (connect timeout=1)'))
2024-05-28 13:00:18,881 [onedrivegui:2498][fn=autostart_monitor][DEBUG] - [<redacted>] Compatible client version found: False

Wait a timeout on Github? I tried opened api.github.com in browser and it responsded albeit a bit slower.

Then I check the code here https://github.com/bpozdena/OneDriveGUI/blob/8c5b75f87ae402cb7e2ffa9b0ab0e5bba7182e56/src/OneDriveGUI.py#L2461 and changes the timeout to be a bit reasonable 10s from previously hardcoded 1s, and then the OnedriveGUI went normal again.

I mean seriously, why would me loading a Github a bit slower render the client useless with wrong error message. I hope this can be fixed in upstream.

Thanks

System info LSB Version: n/a Distributor ID: Arch Description: Arch Linux Release: rolling Codename: n/a GNOME wayland Python 3.12.3 /usr/bin/onedrive onedrive v2.5.0-rc2

bpozdena commented 3 months ago

@initrunlevel0 , thanks for the report.

The bigger issue here is that the online version check should be just an informative feature. It should not have any effect on the GUI or client functionality.

It's now corrected in the RC2 branch. You will now be able to start the sync even with no connectivity to Github. Any potential connectivity issues with OneDrive servers will be handled by the OneDrive client.

image