Bug 495555

Summary: When Filelight is installed as a Flatpak, only "Disk Usage Statistics - all devices" menu item works
Product: [Applications] dolphin Reporter: Nate Graham <nate>
Component: bars: statusAssignee: Dolphin Bug Assignee <dolphin-bugs-null>
Status: CONFIRMED ---    
Severity: normal CC: akselmo, dolphin-bugs-null, jared, kde, nicolas.fella
Priority: NOR    
Version First Reported In: 24.08.2   
Target Milestone: ---   
Platform: Flatpak   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Nate Graham 2024-10-29 22:39:05 UTC
STEPS TO REPRODUCE
1. Install Filelight from Flatpak, and not distro packages
2. Open Dolphin
3. Click on the button on the status bar that shows Filelight-related free space investigation options when it's installed, and an option to install it when it's not installed
4. Click all the menu options

OBSERVED RESULT
Only the "Disk Usage Statistics - all devices" menu item works, and simply launches the app showing its homepage. The other menu items do nothing.

EXPECTED RESULT
A set of menu items tailored to the capabilities actually available in Filelight when it's packaged as a Flatpak.
Comment 1 Nicolas Fella 2024-10-30 11:30:48 UTC
flatpak run --command=filelight --file-forwarding org.kde.filelight @@u file:///home/nico/ @@ 

results in 

flatpak[288520]: Fehler: Invalid fd passed

This is either a bug or fundamental limitation in flatpak. It doesn't accept directory urls as arguments
Comment 2 Nicolas Fella 2024-10-30 11:33:22 UTC
https://github.com/flatpak/flatpak/issues/4799
Comment 3 David Edmundson 2024-10-31 14:39:29 UTC
>flatpak run --command=filelight --file-forwarding org.kde.filelight @@u file:///home/nico/ @@ 

Whilst true, why is it doing that?

 flatpak run org.kde.filelight /home/david/projects   

works absolutely fine.

It requires filelight to have the right permissions to read all user files, but we need that anyway?
Comment 4 Akseli Lahtinen 2024-10-31 14:42:38 UTC
I got `flatpak run --command=filelight --file-forwarding org.kde.filelight @@u file:///home/akseli/ @@` to work if i enabled the All user files read-only and All system files read-only in the flatpak settings for filelight
Comment 5 Nicolas Fella 2024-10-31 14:53:45 UTC
> Whilst true, why is it doing that?

Because Flatpak turns "Exec=filelight %u" into that
Comment 6 Nicolas Fella 2024-10-31 14:56:04 UTC
> It requires filelight to have the right permissions to read all user files, but we need that anyway?

In theory we don't need that because whenever we launch Filelight with a dir as argument or open one from the file chooser we get access to it
Comment 7 David Edmundson 2024-10-31 15:41:04 UTC
Even if that was how flatpak worked when forwarding files, when the user presses "up" or "overview" they would get absolute garbage that doesn't match their system.
Comment 8 David Edmundson 2024-11-04 10:32:22 UTC
FWIW, the flatpak manifest *in filelight* allows access everywhere

The Flatpak manifest in flathub does not, it used to, but then was changed with: https://github.com/flathub/org.kde.filelight/pull/14