From 8afcef79a93b1a42595b543188af5bc16727f0f8 Mon Sep 17 00:00:00 2001 From: SiMachines Date: Sun, 21 Jun 2026 11:13:46 -0400 Subject: [PATCH] Improve update check and UI responsiveness - Added exception handling for the update check to silently skip if no internet connection is available. - Deferred the update check using a QTimer to ensure the UI loads instantly, even without an internet connection. - Adjusted the timeout for GitHub API requests to 1 second to prevent blocking during startup. --- main.py | 8 ++++++-- updater.py | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index eb126dff..2d3a2f23 100644 --- a/main.py +++ b/main.py @@ -265,7 +265,10 @@ def check_configurator_update(self): if donotnotify: return - release = updater.GithubRelease.get_latest_release(updater.GUIREPO) + try: + release = updater.GithubRelease.get_latest_release(updater.GUIREPO) + except Exception: + return # No internet — silently skip update check if not release: return releaseversion,_ = updater.GithubRelease.get_version(release) @@ -1076,7 +1079,8 @@ def process_events(): window.setWindowTitle(PyQt6.QtCore.QCoreApplication.translate("MainUi", "Open FFBoard Configurator")) window.setWindowIcon(PyQt6.QtGui.QIcon(helper.res_path('app.ico'))) window.show() - window.check_configurator_update() # Check for updates after window is shown + # Defer update check so UI loads instantly even without internet + PyQt6.QtCore.QTimer.singleShot(2000, window.check_configurator_update) window.autoconnect() exit_code = app.exec() diff --git a/updater.py b/updater.py index a8aa8923..fa08f6dc 100644 --- a/updater.py +++ b/updater.py @@ -48,7 +48,7 @@ def get_latest_release(repo : str): """Returns the latest release for repo or empty dict on error""" url = f"https://api.github.com/repos/{repo}/releases/latest" try: - response = requests.get(url,timeout=3) # timeout to avoid blocking when board connecting + response = requests.get(url,timeout=1) # 1s timeout to avoid blocking startup except requests.ConnectionError: return {} if not response: