UnixFS duplicate paths during import
Following on from https://github.com/ipfs/js-ipfs/issues/2622
You can have the situation where a user tries to build a UnixFS directory with duplicate paths:
await ipfs.add([{
path: 'folder/file',
content: Buffer.from('hello world')
}, {
path: 'folder/file',
content: Buffer.from('another hello world')
}])
Current behaviour is last-file-wins for both go-IPFS and js-IPFS.
Should this be the case or should they error? The API makes it trivial to do this kind of operation, but file systems typically do not support entries with duplicate names.
Once there is an agreement, this should be documented in the spec order for DAGs to be recreated without reference to go-IPFS or js-IPFS.
@achingbrain reference: https://github.com/ipfs/go-ipfs/issues/4292
I'd like to make it an error. I'd also like to enforce stable directory orders and check for duplicates when reading directories.