Open lidel opened 3 months ago
When people attempt to add content that is not unixfs to MFS, should we prompt users to re-encode the data as unix-fs? I feel like the majority of webui users are unaware what type of content CIDs they're passing around is, and likely just want to add it to webui/desktop. The easier we make that, the happier they would be.
https://github.com/ipfs/kubo/issues/7999, https://github.com/ipfs/kubo/issues/8144, https://github.com/ipfs/kubo/issues/7172 still hunts us https://github.com/ipfs/ipfs-webui/issues/2205.
I think we should make
ipfs files cp /ipfs/cid /mfs-destination
at least check the root cid, and error if it is not a valid UnixFS node or has codec other thanraw
ordag-pb
.This way it is less likely people import non-UnixFS to MFS (majority of time, it will be root cid at fault). This would fix both CLI and ipfs-webui.
ps. while we are at this, we should also add
--force
mentioned in https://github.com/ipfs/kubo/issues/2074 (we already have it forrm
, but notcp
)