Skip to content

verify.py: make verification non-blocking and fix mirror/HWE URLs (#148) - #156

Closed
ronitgupta138 wants to merge 2 commits into
linuxmint:masterfrom
ronitgupta138:fix/verify-async-and-mirror-urls
Closed

ronitgupta138 wants to merge 2 commits into
linuxmint:masterfrom
ronitgupta138:fix/verify-async-and-mirror-urls

Conversation

@ronitgupta138

Copy link
Copy Markdown

Fixes #148

Summary of Changes:

  1. Prevent UI Freezes: Decorated verify_url and verify_files with @async_function and UI updates (show_result, dialog) with @idle_function so GPG keyserver lookups and checksum verification run asynchronously without locking the GTK main loop.
  2. Updated Mirror Host: Switched default MINT_MIRROR to https://mirrors.edge.kernel.org/linuxmint to avoid 301 redirection delays.
  3. Support HWE ISOs: Added detection for -hwe ISOs in guess_urls to query https://mirrors.edge.kernel.org/linuxmint/hwe/sha256sum.txt.
  4. Resilient HKPS Keyservers: Prioritized encrypted HKPS keyservers (hkps://keyserver.ubuntu.com, hkps://keys.openpgp.org) over plaintext port 11371 to avoid firewall blocking.

Copilot AI lite review requested due to automatic review settings September 27, 2026 15:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Three unresolved critical concurrency and callback issues block safe approval.

Review effort: Lite
Findings: 3 High severity

Open (3)
What changed in this PR

This PR makes ISO verification asynchronous and updates Linux Mint mirror, HWE, and HKPS keyserver handling.

Changes:

  • Runs URL and file verification asynchronously.
  • Marshals GTK updates and dialogs to the main loop.
  • Updates mirror URLs and adds HWE ISO detection.
  • Prioritizes encrypted keyservers.
File Summary
lib/​verify.py Adds asynchronous verification and URL updates. Three critical issues remain: keyword arguments break idle_function, GTK controls are accessed off the main thread, and concurrent verification can race on shared files and the GPG keyring.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread lib/verify.py Outdated
self.show_result("dialog-error", _("Checksum mismatch"),
summary=_("Download the ISO image again. Its checksum does not match."))

@async_function
Comment thread lib/verify.py Outdated
self.show_result("dialog-error", _("Checksum mismatch"),
summary=_("Download the ISO image again. Its checksum does not match."))

@async_function
Comment thread lib/verify.py
return (False, _("The SHA256 sum of the ISO image is incorrect."))
return (False, _("The SHA256 sums file does not contain sums for this ISO image."))

@idle_function
…gs in idle_function, and marshal GTK widget access to main thread
@ronitgupta138

Copy link
Copy Markdown
Author

Updated to resolve all 3 concurrency and callback issues:

  1. Isolated Verification State: Replaced global shared paths with per-run tempfile.TemporaryDirectory() and isolated gnupg.GPG(gnupghome=tmpdir) instances, and disabled verify action buttons during an in-flight verification job.
  2. Main-Thread GTK Access: Widget values (text entries and filechooser paths) are now captured in the UI callback on the main thread and passed as plain strings into background workers.
  3. Kwargs in idle_function: Updated the decorator to preserve and forward **kwargs via GLib.idle_add(lambda: func(*args, **kwargs)) so calls with keyword parameters (summary, details) execute properly.

@ronitgupta138 ronitgupta138 closed this by deleting the head repository Oct 16, 2026
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.

mint-iso-verify crashes on LMDE 7 with LMDE 7 iso

2 participants