Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

ipfs.files.add with {cidVersion: 1} returns CID of an empty file #1518

Closed
ipfs-inactive/js-ipfs-unixfs-engine
#227
@lidel

Description

@lidel

This was originally found as a part of #1440 and ipfs/js-ipfs-http-response#9

  • Version: js-ipfs 0.31.6
  • Platform: Node
  • Subsystem:

Type: Bug

Severity: High

Description:

For some inputs ipfs.files.add with {cidVersion: 1} returns a CIDv1 of an empty file, instead of CID for the actual input buffer.

The problem does not occur if {cidVersion: 0} is used.

Steps to reproduce the error:

I attach test case that illustrates the issue: js-ipfs-add-cidv1-bug-repro.zip

To run it: yarn && yarn test (or npm install && npm test)

Metadata

Metadata

Assignees

Labels

P1High: Likely tackled by core team if no one steps upexp/expertHaving worked on the specific codebase is importanthelp wantedSeeking public contribution on this issuekind/bugA bug in existing code (including security flaws)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions