ipfs-webui icon indicating copy to clipboard operation
ipfs-webui copied to clipboard

feat: allow `files rm --force`

Open SgtPooki opened this issue 6 months ago • 0 comments

Is your feature request related to a problem? Please describe. It's possible for users to get into a state where they have non-unixfs files in MFS, which will result in errors like Error: unrecognized node type in cache node.

When non-unixfs files are in MFS, removal of those files will fail in webui without error.

They also fail to be removed in the command line unless rm --force is used.

Describe the solution you'd like When a user attempts to remove a file, we should provide an option to "force" remove the file.

Describe alternatives you've considered

We may also want to enable a fallback prompt to "force" remove files when a user attempts to remove a file and it fails.

Additional context

We should also prevent users from adding/importing non-unixfs files via the webui (I believe I added the files that got me into this state via the webui)

Code that needs updated

  • https://github.com/ipfs/ipfs-webui/blob/5abc5d07630cef5a62d05194053e678750012d18/src/files/modals/add-by-path-modal/AddByPathModal.js#L25-L31

Related issues

  • https://github.com/ipfs/ipfs-webui/issues/2158#issuecomment-1714359513
  • https://ipshipyard.slack.com/archives/C04M8232QRW/p1706905541073949
  • https://github.com/ipfs/kubo/issues/8144
  • https://github.com/ipfs/kubo/issues/7999
  • https://github.com/ipfs/kubo/issues/10331
### Tasks
- [ ] validate unixfs content at /src/files/modals/add-by-path-modal/AddByPathModal.js#L25-L31

SgtPooki avatar Feb 05 '24 15:02 SgtPooki