GNOME Bugzilla – Bug 780472
Cannot delete files in flatpak version
Last modified: 2017-09-26 23:43:34 UTC
In the flatpak version it isn't possible to delete files from the left sidebar. "Move to trash". Nothing is happening.
Weird, it seems like it should work. $ flatpak run --talk-name=org.gtk.vfs.* --talk-name=org.gtk.vfs --filesystem=host --filesystem=home org.gnome.Sdk sh-4.3$ python3 >>> from gi.repository import Gio >>> f = Gio.File.new_for_path('/home/christian/Projects/rtfm/Makecache') >>> f.query_exists() True >>> f.trash() True >>> f.query_exists() False >>> But when running with Builder, I get: WARNING: Unable to trash file /home/christian/Projects/jsonrpc-glib/Makecache across filesystem boundaries
Also, if i do the above test case, but use --command=bash with org.gnome.Builder instead of org.gnome.Sdk, I get the failure. So it must be some issue with our manifest.
So when I compare the mounts between the above, it looks like we map in /home/christian/.local/share/flatpak to get access to the users Flatpak installation. However, .local/share/Trash is the location for trash. The descendant bind-mount might be confusing things.
Okay, bit more digging... It looks like .var/app/org.gnome.Builder/data/Trash is where Gio is trying to move the file. Then it fails a cross-device check later on.
*** Bug 783946 has been marked as a duplicate of this bug. ***
Created attachment 360504 [details] [review] project: use "gio trash" under flatpak Until we have a working implementation of trash detecting cross-filesystem boundary moves, we should have a fallback that still tries to trash the file correctly (without being destructive). This falls back to "gio trash $uri" on the host. While not ideal, it should be enough to do the right thing as a stop gap.
The workaround we have for this should at least enable things to work, but we should certainly try to fix things better in Gio so that all applications work. My understanding is that the lower gio layers will need to check /proc/self/mountinfo to determine if something is actually on the same underlying device.