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

UnixFS duplicate paths during import #239

Open
achingbrain opened this issue Feb 5, 2020 · 2 comments
Open

UnixFS duplicate paths during import #239

achingbrain opened this issue Feb 5, 2020 · 2 comments

Comments

@achingbrain
Copy link
Member

Following on from ipfs/js-ipfs#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.

@ribasushi
Copy link
Contributor

@achingbrain reference: ipfs/kubo#4292

@Stebalien
Copy link
Member

I'd like to make it an error. I'd also like to enforce stable directory orders and check for duplicates when reading directories.

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

3 participants