Bug 506528 - "Delete settings and user data" button is inappropriately disabled after uninstalling Flatpak app twice without leaving its page
Summary: "Delete settings and user data" button is inappropriately disabled after unin...
Status: RESOLVED FIXED
Alias: None
Product: Discover
Classification: Applications
Component: Flatpak Backend (other bugs)
Version First Reported In: 6.4.1
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-07-03 11:20 UTC by tramonti.luca18
Modified: 2025-08-27 23:52 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 6.4.5
Sentry Crash Report:


Attachments
The banner saying "Clearing settings and user data..." and with the greyed out "Delete settings and user data" button (12.30 KB, image/png)
2025-07-03 11:21 UTC, tramonti.luca18
Details
A screenshot of the whole discover window showing the bug in action (266.12 KB, image/png)
2025-07-07 21:37 UTC, tramonti.luca18
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tramonti.luca18 2025-07-03 11:20:49 UTC
SUMMARY
If an app gets uninstalled twice on discover without leaving the page of the app and after having cleared the data on the first uninstallation, the "[App] is not installed but it still has data present" banner is stuck in the "Clearing settings and user data..." state while the "Delete settings and user data" button is greyed out, not allowing the user to delete the user data again even though it's present.

STEPS TO REPRODUCE
1. Open discover
2. Install an application
3. Launch said application after installation is done to allow it to create data
4. Close the application
5. Uninstall the application using Discover (do not close discover or navigate to a different page from within discover from now on)
6. Click "Delete settings and user data" on discover
7. Install the same app again
8. Launch it again (so it creates data again)
9. Close the application again
10. Uninstall the application using Discover again

OBSERVED RESULT
The broken banner with the greyed out button will appear

EXPECTED RESULT
The banner is not in the deleting state and normally shows "[App] is not installed but it still has data present" with the "Delete settings and user data" button enabled

SOFTWARE/OS VERSIONS
(available in the Info Center app, or by running `kinfo` in a terminal window)
Linux/KDE Plasma: Fedora Linux 42
KDE Plasma Version: 6.4.1
KDE Frameworks Version: 6.15.0
Qt Version: 6.9.1

ADDITIONAL INFORMATION
I can't test this with distro packages on discover as I'm on an atomic distro, so this issue may only occur with Flatpak applications
Comment 1 tramonti.luca18 2025-07-03 11:21:58 UTC
Created attachment 182895 [details]
The banner saying "Clearing settings and user data..." and with the greyed out "Delete settings and user data" button
Comment 2 TraceyC 2025-07-07 19:33:51 UTC
I tested this on git-master by installing KStars and following the steps to reproduce.
On Solus and on Fedora 42, I see no "Delete settings and user data"

Could you send a screenshot of the window that has that? Thanks.
Comment 3 tramonti.luca18 2025-07-07 21:37:48 UTC
Created attachment 183049 [details]
A screenshot of the whole discover window showing the bug in action
Comment 4 tramonti.luca18 2025-07-07 21:38:14 UTC
(In reply to TraceyC from comment #2)
> I tested this on git-master by installing KStars and following the steps to
> reproduce.
> On Solus and on Fedora 42, I see no "Delete settings and user data"
> 
> Could you send a screenshot of the window that has that? Thanks.

I think the "Delete settings and user data" feature is only available for flatpak applications, anyway I've added an attachment that shows what the window looks like
Comment 5 TraceyC 2025-07-08 15:24:53 UTC
Thanks for the clarification. 
I'm able to reproduce this on git-master using the KStars flatpak and your original testing steps.
Comment 6 Bug Janitor Service 2025-08-27 19:50:03 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/discover/-/merge_requests/1144
Comment 7 Nate Graham 2025-08-27 23:52:09 UTC
Git commit 158ab70cd9934e05b6d82cee80c21f3bcb3ced18 by Nate Graham.
Committed on 27/08/2025 at 23:51.
Pushed by ngraham into branch 'master'.

Re-enable "delete settings" button on re-opening the message

If the user deletes their Flatpak app settings, then reinstalls, and
then uninstalls again, the button to delete the settings will still be
disabled, because nothing re-enabled it after the first time it disabled
itself.

Do so.
FIXED-IN: 6.4.5

M  +6    -0    libdiscover/backends/FlatpakBackend/qml/FlatpakRemoveData.qml

https://invent.kde.org/plasma/discover/-/commit/158ab70cd9934e05b6d82cee80c21f3bcb3ced18
Comment 8 Nate Graham 2025-08-27 23:52:22 UTC
Git commit f1903410fb5b68703f135c6a419dc6d4600ecc6b by Nate Graham.
Committed on 27/08/2025 at 23:52.
Pushed by ngraham into branch 'Plasma/6.4'.

Re-enable "delete settings" button on re-opening the message

If the user deletes their Flatpak app settings, then reinstalls, and
then uninstalls again, the button to delete the settings will still be
disabled, because nothing re-enabled it after the first time it disabled
itself.

Do so.
FIXED-IN: 6.4.5


(cherry picked from commit 158ab70cd9934e05b6d82cee80c21f3bcb3ced18)

Co-authored-by: Nate Graham <nate@kde.org>

M  +6    -0    libdiscover/backends/FlatpakBackend/qml/FlatpakRemoveData.qml

https://invent.kde.org/plasma/discover/-/commit/f1903410fb5b68703f135c6a419dc6d4600ecc6b