Bug 449207

Summary: Canceling Polkit prompt for installing a GHNS item shows an unnecessary error popup
Product: [Frameworks and Libraries] frameworks-knewstuff Reporter: fruu.tee11
Component: generalAssignee: Alexander Lohnau <alexander.lohnau>
Status: CONFIRMED ---    
Severity: minor CC: alexander.lohnau, kdelibs-bugs-null, nate
Priority: NOR    
Version First Reported In: 5.90.0   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description fruu.tee11 2022-01-26 17:55:51 UTC
STEPS TO REPRODUCE
1.  Open System Settings -> Startup and Shutdown -> Login Screen (SDDM)
2.  Click "Get New SDDM Themes.."
3.  Install any theme available for download
4. When prompted with Polkit, click 'Cancel'
5. Observe unnecessary "An Error Occurred" popup

OBSERVED RESULT

A new popup window opens, titled "An Error Occurred", saying

"An error occurred during the installation process:
The installation failed with code 255 while attempting to run the command:
sddmthemeinstaller -i /tmp/plasma-chili.tar.gz

The returned output was:
"

EXPECTED RESULT

No error message would prompt at all, since canceling a PolKit prompt should be considered normal user behavior.

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20220118
KDE Plasma Version: 5.23.5
KDE Frameworks Version: 5.90.0
Qt Version: 5.15.2
Kernel Version: 5.16.0-1-default (64-bit)
Graphics Platform: X11
Processors: 12 × AMD Ryzen 5 2600 Six-Core Processor
Memory: 7.7 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 1660/PCIe/SSE2

ADDITIONAL INFORMATION

The error popup also does not match with my window decoration theme - I assume it is using Breeze by default. I have a screenshot attached. Sometimes, the PolKit also appears behind the "Download New Login Screen - System Settings" window.
Comment 1 Alexander Lohnau 2022-01-27 08:59:59 UTC
I will take care of it, the KRunner plugin KNewStuff installer had a related problem that I fixed a while back. Meaning KNewStuff does not need any changes, only the sddmthemeinstaller.
Comment 2 Alexander Lohnau 2022-01-27 18:42:07 UTC
Not sure why, but KAuth gives one only a AuthorizationDeniedError instead of UserCancelledError when one clicks the cancel button. Meaning we can not tell if the authorization failed or if the user canceled :(
Comment 3 Alexander Lohnau 2022-01-27 20:46:32 UTC
A "solution" would be to simply ignore errors from the auth job.

With the KMessageBox::sorry method call one might argue, that the installer already takes care of displaying the error message in case there is anything to display.

@Nate, what do you think?
Comment 4 Nate Graham 2022-01-27 20:50:46 UTC
I agree and have argued in favor if this in the past.