Bug 509508

Summary: Unable to change permissions of Flatpaks on new installations
Product: [Applications] systemsettings Reporter: jonas.harer <jonas.harer>
Component: kcm_flatpakAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED FIXED    
Severity: major CC: joshiesuhaas0, nate, sitter
Priority: NOR    
Version First Reported In: 6.4.80   
Target Milestone: ---   
Platform: KDE Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Screencast showing the issue

Description jonas.harer 2025-09-15 09:17:24 UTC
Created attachment 184958 [details]
Screencast showing the issue

SUMMARY
When making changes to the permissions of a Flatpak, the changes don't get saved and the ui resets itself to the old permission.

STEPS TO REPRODUCE
1. Change a permission, like "Take screenshots", of a Flatpak

OBSERVED RESULT
The permission does reset itself

EXPECTED RESULT
The permission should change

KDE Plasma Version: 6.4.80
KDE Frameworks Version: 6.19.0
Qt Version: 6.9.2
Comment 1 Harald Sitter 2025-09-15 15:23:03 UTC
The problem appears to be that we skip out of change notifications when there is no table. On new installations or new users there is no table initially and as such we skip all changes. Once you have changed a given field the table exists and the next time around it will update correctly.

https://invent.kde.org/plasma/flatpak-kcm/-/blob/master/permissionstore.cpp?ref_type=heads#L64

We should probably load tables we get notified about. Except the current code doesn't seem to be built around loading tables after construction :\
Comment 2 Bug Janitor Service 2025-09-15 15:29:39 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/flatpak-kcm/-/merge_requests/158
Comment 3 Harald Sitter 2025-09-16 09:26:37 UTC
Git commit a96aeaf28dd4f78b8256386c17c9ae308eb29c3a by Harald Sitter.
Committed on 16/09/2025 at 09:14.
Pushed by sitter into branch 'master'.

permissionstore: load unknown tables

when there are no permissions present, such as on a new user, the
initial table load won't do anything leading to us not tracking any
tables and by extension ignoring all permission changes.

instead load the table on-demand when that happens.

as a side effect we now need to issue permissionChanged on table load so
the model updates correctly

M  +4    -0    permissionstore.cpp

https://invent.kde.org/plasma/flatpak-kcm/-/commit/a96aeaf28dd4f78b8256386c17c9ae308eb29c3a