Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trashing files not working #222

Open
twelho opened this issue Aug 31, 2023 · 13 comments
Open

Trashing files not working #222

twelho opened this issue Aug 31, 2023 · 13 comments
Assignees

Comments

@twelho
Copy link

twelho commented Aug 31, 2023

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 flatpak/xdg-desktop-portal#114, but the workaround of --talk-name=org.gtk.vfs --talk-name=org.gtk.vfs.* doesn't seem to work either.

@twelho
Copy link
Author

twelho commented Aug 31, 2023

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 noonsleeper self-assigned this Oct 20, 2023
@noonsleeper
Copy link
Collaborator

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

@twelho
Copy link
Author

twelho commented Oct 20, 2023

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
Copy link
Collaborator

@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
Copy link
Author

twelho commented Nov 20, 2023

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
Copy link
Collaborator

@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
Copy link
Author

twelho commented Nov 20, 2023

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
Copy link
Collaborator

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
Copy link
Author

twelho commented Nov 20, 2023

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

@twelho
Copy link
Author

twelho commented Nov 20, 2023

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
Copy link
Collaborator

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

@twelho
Copy link
Author

twelho commented Nov 21, 2023

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
Copy link
Collaborator

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants