Skip to content

shell.trashItem() fails on tmpfs filesystems #28045

Closed as not planned
Closed as not planned

Description

@ckerr

tldr: there are edge cases where gio trash will fail and in those cases we could use a fallback approach to trashing files in shell/common/platform_util_linux.cc's PlatformTrashItem().

Same issue exists in the older blocking-API function shell.moveItemToTrash().

The same gio trash trash can be seen from the command line. For example:

$ df --output=fstype,target /home
Type  Mounted on
ext4 /home
$ echo 'Hello, World!' > "$HOME"/test.txt
$ gio trash "$HOME"/test.txt
$ echo $?
0
$
$ df --output=fstype,target /tmp
Type Mounted on
tmpfs /tmp
$ echo 'Hello, World!' > /tmp/test.txt
$ gio trash /tmp/test.txt
$ gio: file:///tmp/test.txt: Trashing on system internal mounts is not supported
$ echo $? 
1

Downstream related Atom issue: atom/tree-view#1237
Upstream related glib issue: https://gitlab.gnome.org/GNOME/glib/-/issues/1722

Preflight Checklist

  • I have read the Contributing Guidelines for this project.
  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.

Issue Details

  • Electron Version:
    • 11.0.0, 12.0.0
  • Operating System:
    • Linux
  • Last Known Working Electron version:
    • None

Expected Behavior

The file should be trashed

Actual Behavior

The file is not trashed (though it does correctly throw an exception that the operation failed)

To Reproduce

https://gist.github.com/7fd1ca22aa15b089fc6573a0dd67841d

Activity

  1. added
    has-repro-gist
    on Mar 8, 2021
  2. github-actions commented on Oct 6, 2022

    @github-actions
    Contributor

    This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

  3. github-actions commented on Nov 7, 2022

    @github-actions
    Contributor

    This issue has been closed due to inactivity, and will not be monitored. If this is a bug and you can reproduce this issue on a supported version of Electron please open a new issue and include instructions for reproducing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    11-x-y12-x-yhas-repro-gistplatform/linuxstale

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions