Bug 457992

Summary: KDE Connect Flatpak and permissions to directories
Product: [Applications] kdeconnect Reporter: pak0st <kokotekilata>
Component: commonAssignee: Albert Vaca Cintora <albertvaka>
Status: REPORTED ---    
Severity: normal CC: kokotekilata
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Flatpak   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description pak0st 2022-08-17 12:23:59 UTC
SUMMARY
The Flatpak version doesn't have the expected Filesystem permissions for file transfers.
No error is present when failing to send or receive files.

STEPS TO REPRODUCE
1. Install the Flatpak version of KDE connect
2. Attempt to share a file to the device using a different machine

OBSERVED RESULT
Short popup for receiving file that disappears immediately.
The file itself is not received or saved as expected.

No output in terminal with potential permission error when running with:
`flatpak run --branch=master --arch=x86_64 --arch=x86_64 --comand=kdeconnect-app org.kde.connect`

EXPECTED RESULT
The file is stored in the default `~/Downloads/` directory for the user.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
SteamOS 3.3 build 20220803.1
Stable channel

(available in About System)
KDE Plasma Version: 5.23.5
KDE Frameworks Version: 5.90.0
Qt Version: 
```
$ pacman -Si qt5-base
Version: 5.15.2+kde+r294-1
```

KDE Connect version:
`21.12.3, released on 3 Mar 2022`

ADDITIONAL INFORMATION

The files can be received if you add the `~/Downloads` dir from Flatseal in the Filesystem section.
 
Attempting to send share files from the Steam Deck throws the following output in the terminal (only when hitting "Share file" button):

```
kf.solid.backends.udisks2: Failed enumerating UDisks2 objects: "org.freedesktop.DBus.Error.Disconnected" 
 "Not connected to D-Bus server"
kf.solid.backends.udisks2: Failed enumerating UDisks2 objects: "org.freedesktop.DBus.Error.Disconnected" 
 "Not connected to D-Bus server"
kf.solid.backends.udisks2: Failed enumerating UDisks2 objects: "org.freedesktop.DBus.Error.Disconnected" 
 "Not connected to D-Bus server"
kf.solid.backends.udisks2: Failed enumerating UDisks2 objects: "org.freedesktop.DBus.Error.Disconnected" 
 "Not connected to D-Bus server"
kf.solid.backends.udisks2: Failed enumerating UDisks2 objects: "org.freedesktop.DBus.Error.Disconnected" 
 "Not connected to D-Bus server"
kf.solid.backends.udisks2: Failed enumerating UDisks2 objects: "org.freedesktop.DBus.Error.Disconnected" 
 "Not connected to D-Bus server"
kf.solid.backends.udisks2: Failed enumerating UDisks2 objects: "org.freedesktop.DBus.Error.Disconnected" 
 "Not connected to D-Bus server"
kf.solid.backends.udisks2: Failed enumerating UDisks2 objects: "org.freedesktop.DBus.Error.Disconnected" 
 "Not connected to D-Bus server"
```

The Filesystem permissions observed from `Flatseal` for `KDE Connect`:
```
xdg-run/gvfs # Manually added
xdg-run/gvfsd # Manually added
xdg-config/gtk-3.0:ro
xdg-config/kdeglobals:ro
```
Comment 1 pak0st 2022-08-18 15:06:13 UTC
Come to think of it, the best solution is for KDE Connect to request access the directory or file if the Flatpak doesn't already.