Skip to content

Fix UI freeze during driverless PPD validation - #480

Draft
SinghCod3r wants to merge 2 commits into
masterfrom
fix/driverless-ppd-validation-async
Draft

SinghCod3r wants to merge 2 commits into
masterfrom
fix/driverless-ppd-validation-async

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.

Supersedes #479

This PR contains the same implementation previously submitted in #479. The previous PR was closed after its source branch was deleted. The implementation itself has been preserved and is now submitted from fix/driverless-ppd-validation-async.

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