Skip to content

Fix Preferences dialog blocking on AI update check - #21501

Merged
TurboGit merged 1 commit into
darktable-org:masterfrom
andriiryzhkov:fix_21498
Jul 7, 2026
Merged

TurboGit merged 1 commit into
darktable-org:masterfrom
andriiryzhkov:fix_21498

Conversation

@andriiryzhkov

Copy link
Copy Markdown
Collaborator

Closes #21498

dt_ai_models_check_updates ran synchronously on the GTK main thread when the AI preferences panel opened. Two HTTP calls to GitHub (release listing + versions.json fetch) with a combined 45s timeout worst case – when the network was slow or unreachable, the whole Preferences dialog froze until the calls timed out.

Fix:

  • Split the check into a background worker (_check_updates_worker, network + JSON parse only, no registry access) and a main-thread idle callback (_apply_updates_idle, does the registry mutation and raises DT_SIGNAL_AI_MODELS_CHANGED). Preferences opens instantly; the model list auto-refreshes 1–5s later when the worker completes
  • Wire the AI preferences panel to listen for DT_SIGNAL_AI_MODELS_CHANGED so it re-populates when the async check finishes
  • Tighten curl timeouts on the update-check path from 30s / 15s to 5s + explicit CONNECTTIMEOUT=5s. Caps worst-case background work at ~10s on total network failure

@andriiryzhkov andriiryzhkov added this to the 5.6.1 milestone Jul 6, 2026
@andriiryzhkov andriiryzhkov added bugfix pull request fixing a bug scope: AI features AI features related issues and PR labels Jul 6, 2026

@TurboGit TurboGit left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@TurboGit

TurboGit commented Jul 7, 2026

Copy link
Copy Markdown
Member

Needs a release note entry, TIA.

@TurboGit
TurboGit merged commit c354154 into darktable-org:master Jul 7, 2026
5 checks passed
@andriiryzhkov
andriiryzhkov deleted the fix_21498 branch July 8, 2026 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix pull request fixing a bug scope: AI features AI features related issues and PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AI module: Opening the Preferences dialog is significantly delayed when network connectivity is poor

2 participants