Bug 465818 - Flatpak KCM doesn't create proper overrides because of translations
Summary: Flatpak KCM doesn't create proper overrides because of translations
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_flatpak (show other bugs)
Version: 5.27.0
Platform: openSUSE Linux
: VHI normal
Target Milestone: ---
Assignee: Harald Sitter
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-16 06:42 UTC by ae6b2s5p7
Modified: 2023-03-02 01:57 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.27.1


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ae6b2s5p7 2023-02-16 06:42:42 UTC
SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***


STEPS TO REPRODUCE
1. Install Turkish language and activate
2. Open Flatpak KCM via system settings and try to create some overrides
3. Open the configured Flatpak app

OBSERVED RESULT
Overrides don't change anything

EXPECTED RESULT
Changed permissions of an Flatpak app

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Opensuse Tumbleweek 20230214
(available in About System)
KDE Plasma Version: 5.27.0
KDE Frameworks Version: 5.103.0
Qt Version: 5.15.8

ADDITIONAL INFORMATION

For example, if I try to revoke access of Obsidian to home folder, it can still access it. But if I can use Flatseal, it works. 

When I opened Flatpak's overrides folder and created override file for Obsidian, I noticed Flatpak KCM creates rules in Turkish, "dosyasistemi" instead of "filesystem" but Flatseal creates in English even if it uses Turkish language pack. Removing kcm_flatpak_lang from the system worked as a workaround.

By the way, Flatpak KCM looks like it changed permissions and created proper overrides in system settings panel but as it uses Turkish language for keys, it's only cosmetic.
Comment 1 Nate Graham 2023-02-16 14:55:01 UTC
Oops. Can reproduce.
Comment 2 Bug Janitor Service 2023-02-16 17:28:31 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/flatpak-kcm/-/merge_requests/40
Comment 3 Harald Sitter 2023-02-17 13:27:43 UTC
Git commit 3d2a355aec552f49394975550aa36d3e3634302c by Harald Sitter.
Committed on 17/02/2023 at 13:09.
Pushed by sitter into branch 'master'.

always use frontend strings but convert to backend strings when saving

this resolves various localization problems where we got confused
between frontend strings (localized) and backend strings (english-y
config file strings). in an attempt to keep this change fairly
conservatively the entire code base now should assume that Value
instances inside the Permission object are localized and must be
delocalized for writing to file.

for filesystem entries that was kind of working already and has been
extended to cover (hopefully) all branches where writeouts occur.

for dbus entries this is now also the behavior and assisted by back and
forth conversion helper functions.

dbus entries also had their config file manipulation adjusted to be a
tad easier to read and a lot more reliable

further refactoring is advised: ideally there'd be a sensible split
between frontend and backend strings so the backend code only ever deals
with backend strings and the conversion for displaying happens
separately from that. also the config file writing/management seems
overly fragile at a glance. the config file management possibly should
get split out of the model so it is easier to comprehensively unit test
it. there should just never be a case where the config breaks because of
us :|
FIXED-IN: 5.27.1

M  +90   -49   flatpakpermission.cpp

https://invent.kde.org/plasma/flatpak-kcm/commit/3d2a355aec552f49394975550aa36d3e3634302c
Comment 4 Harald Sitter 2023-02-17 14:28:13 UTC
Git commit 5d6a1c0536da8114f1f9ba9d341e3b419839d4e3 by Harald Sitter.
Committed on 17/02/2023 at 13:44.
Pushed by sitter into branch 'Plasma/5.27'.

always use frontend strings but convert to backend strings when saving

this resolves various localization problems where we got confused
between frontend strings (localized) and backend strings (english-y
config file strings). in an attempt to keep this change fairly
conservatively the entire code base now should assume that Value
instances inside the Permission object are localized and must be
delocalized for writing to file.

for filesystem entries that was kind of working already and has been
extended to cover (hopefully) all branches where writeouts occur.

for dbus entries this is now also the behavior and assisted by back and
forth conversion helper functions.

dbus entries also had their config file manipulation adjusted to be a
tad easier to read and a lot more reliable

further refactoring is advised: ideally there'd be a sensible split
between frontend and backend strings so the backend code only ever deals
with backend strings and the conversion for displaying happens
separately from that. also the config file writing/management seems
overly fragile at a glance. the config file management possibly should
get split out of the model so it is easier to comprehensively unit test
it. there should just never be a case where the config breaks because of
us :|
FIXED-IN: 5.27.1
(cherry picked from commit 3d2a355aec552f49394975550aa36d3e3634302c)

M  +90   -49   flatpakpermission.cpp

https://invent.kde.org/plasma/flatpak-kcm/commit/5d6a1c0536da8114f1f9ba9d341e3b419839d4e3
Comment 5 ratijas 2023-03-02 01:56:45 UTC
Git commit 7cf1da69d30cdd8efbb563070e0bdaf303ef118a by ivan tkachenko.
Committed on 02/03/2023 at 01:56.
Pushed by ratijas into branch 'master'.

Fix inappropriately localized permission name "per-app-dev-shm"

Which corresponds to FLATPAK_CONTEXT_FEATURE_PER_APP_DEV_SHM value from
FlatpakContextFeatures enum in Flatpak internals.

Amends 3d2a355aec552f49394975550aa36d3e3634302c.
FIXED-IN: 5.27.3

M  +1    -1    flatpakpermission.cpp

https://invent.kde.org/plasma/flatpak-kcm/commit/7cf1da69d30cdd8efbb563070e0bdaf303ef118a
Comment 6 ratijas 2023-03-02 01:57:19 UTC
Git commit c108ef2b53918265d113d2d97721f88a3f9ed486 by ivan tkachenko.
Committed on 02/03/2023 at 01:57.
Pushed by ratijas into branch 'Plasma/5.27'.

Fix inappropriately localized permission name "per-app-dev-shm"

Which corresponds to FLATPAK_CONTEXT_FEATURE_PER_APP_DEV_SHM value from
FlatpakContextFeatures enum in Flatpak internals.

Amends 3d2a355aec552f49394975550aa36d3e3634302c.
FIXED-IN: 5.27.3
(cherry picked from commit 7cf1da69d30cdd8efbb563070e0bdaf303ef118a)

M  +1    -1    flatpakpermission.cpp

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