flathub / com.vscodium.codium

https://flathub.org/apps/details/com.vscodium.codium
96 stars 21 forks source link

Trashing files not working #222

Closed twelho closed 5 months ago

twelho commented 1 year ago

Deleting a file and selecting "Move to Trash" shows this warning:

Screenshot_20230831_223937

I've tried forwarding xdg-data/Trash to the Flatpak to no avail. Searching for this issue results leads to https://github.com/flatpak/xdg-desktop-portal/issues/114, but the workaround of --talk-name=org.gtk.vfs --talk-name=org.gtk.vfs.* doesn't seem to work either.

twelho commented 1 year ago

I ran the Flatpak with --verbose --log-level debug and got the following output:

[18:0831/224625.607184:INFO:CONSOLE(627)] "%c  ERR color: #f33 Failed to move 'test.txt' to the trash: Unknown (FileSystemError): Failed to move 'test.txt' to the trash
    at n.create (/app/share/codium/resources/app/out/vs/code/electron-main/main.js:37:4518)
    at i (/app/share/codium/resources/app/out/vs/code/electron-main/main.js:37:4650)
    at m.delete (/app/share/codium/resources/app/out/vs/code/electron-main/main.js:42:55612)", source: vscode-file://vscode-app/app/share/codium/resources/app/out/vs/workbench/workbench.desktop.main.js (627)
noonsleeper commented 1 year ago

@twelho, sorry for the delay! This persists in the latest version?

twelho commented 1 year ago

Yes, the issue persists in the latest build:

Version: 1.83.1
Release: 23285
Commit: 36d13de33ac0d6c684f10f99cff352e2f58228b3
Date: 2023-10-12T18:26:29.496Z
Electron: 25.8.4
ElectronBuildId: undefined
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
noonsleeper commented 12 months ago

@twelho hey, maybe you could use flatseal to reset all the permissions for codium, I was testing this and all de files that I delete goes to the trash can.

twelho commented 11 months ago

It likely works for you as the Flatpak uses --filesystem=host by default, which I have disabled globally due to it being unsafe. Ideally Flatpak'ed applications should use the trash portal for this. In the meantime, I tried forwarding xdg-data/Trash and ~/.local/share/Trash to the Flatpak, but neither seems to do the trick.

noonsleeper commented 11 months ago

@twelho, I try with this permissions image

and then within the codium file explorer remove a file and that file goes to the trash as espected image

I tested this on F39 silverblue image

twelho commented 11 months ago

Hmm, I'm on Fedora Kinoite 38. With this setup it still doesn't work:

$ flatpak override --user --show com.vscodium.codium
[Context]
filesystems=~/.local/share/Trash;xdg-data/Trash

$ flatpak override --user --show 
[Context]
filesystems=!host

If you run flatpak enter com.vscodium.codium bash and then in the Flatpak ls -la ~/.local/share/Trash, is the directory present? For me it isn't.

noonsleeper commented 11 months ago

If you run flatpak enter com.vscodium.codium bash and then in the Flatpak ls -la ~/.local/share/Trash, is the directory present? For me it isn't.

image

yes, indeed

twelho commented 11 months ago

That's an oddity on my end then. What does env | grep XDG_DATA show for you?

twelho commented 11 months ago

Actually, none of the overrides I try work for VS Codium. Even if I set --filesystem=home, the home directory is still empty inside the Flatpak, even after flatpak kill com.vscodium.codium. Will take a closer look at this in the coming days, as this definitely works for other Flatpaks.

noonsleeper commented 11 months ago

Maybe you can try to uninstall vscodium and use flatsweep to clean all, then install it again?

twelho commented 11 months ago

Tried that, didn't help. The home directory inside the Flatpak is still empty, apart from .local/share/flatpak, which is just an empty directory.

noonsleeper commented 8 months ago

@twelho Can you try this?

flatpak override --user --reset com.vscodium.codium
flatpak permission-reset --user com.vscodium.codium

Because I test this on a series vms (ubuntu 22.04, debian 12, fedora silverblue 38/39) and works as expected.

noonsleeper commented 5 months ago

@twelho I tested this today and at least on Fedora Silverblue 39 it's working as expected, Can you confirm if it is working?

noonsleeper commented 5 months ago

@twelho I'll close this, if you found any other problem, please don't hesitate and open a new issue.