Skip to content

Fix UI freeze during driverless PPD validation - #479

Closed
SinghCod3r wants to merge 2 commits into
masterfrom
migration_phase_1
Closed

SinghCod3r wants to merge 2 commits into
masterfrom
migration_phase_1

Conversation

@SinghCod3r

Copy link
Copy Markdown
Collaborator

Summary

Driverless PPD validation can block the GTK main loop while getServerPPD() performs a CUPS IPP request. This causes the s-c-p UI to freeze temporarily while searching for drivers.

This change moves driverless PPD validation off the GTK main thread and resumes the printer-installation flow when validation completes.

Changes

  • Run driverless PPD validation asynchronously instead of blocking the GTK main loop.
  • Use a separate CUPS connection for the background validation request.
  • Resume the installation state machine through the GTK main loop after validation completes.
  • Ignore stale completion callbacks when the dialog has been destroyed or a newer validation is active.
  • Preserve the validated driverless PPD in the existing cache/catalog flow.
  • Return INSTALL_RESULT_OPS_PENDING while asynchronous validation is in progress.
  • Update test_newprinter.py to model the asynchronous validation/completion flow without globally monkeypatching production methods.
  • Remove the obsolete test patching approach.

Testing

Focused tests:

pytest -q test_newprinter.py test_PhysicalDevice.py
97 passed

Full test suite:

pytest -q
111 passed, 1 failed

The remaining failure is in test_ppds.py and is caused by the local CUPS/PPD catalog mismatch for the Epson Stylus D78 and Canon iP3000. This failure is pre-existing and is unrelated to these changes.

Also verified:

  • git diff --check passes.
  • The existing driverless printer installation flows continue to pass.
  • The GUI no longer requires a second Forward click after asynchronous driverless validation completes.
  • The driver-selection flow no longer briefly exposes the Apply button when returning to the driver-selection page.

@SinghCod3r

Copy link
Copy Markdown
Collaborator Author

@alexpevzner

@SinghCod3r
SinghCod3r marked this pull request as ready for review October 6, 2026 13:54
@SinghCod3r SinghCod3r closed this Oct 6, 2026
@SinghCod3r
SinghCod3r deleted the migration_phase_1 branch October 6, 2026 17:54
@SinghCod3r

Copy link
Copy Markdown
Collaborator Author

@alexpevzner , due to wrong naming of the branch i have renamed the branch and removed this by closing it from my side. I preserved the code in #480 with correct branch name. So you can review that PR.

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.

1 participant