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

The file is broken when using AsyncIterable in addAll . #4344

Closed
jclab-joseph opened this issue Apr 20, 2023 · 2 comments
Closed

The file is broken when using AsyncIterable in addAll . #4344

jclab-joseph opened this issue Apr 20, 2023 · 2 comments
Assignees

Comments

@jclab-joseph
Copy link

jclab-joseph commented Apr 20, 2023

  • Version: js-ipfs 60.0.0
{
  version: '0.17.0',
  commit: '',
  repo: '12',
  system: 'amd64/linux',
  golang: 'go1.19.1',
  'ipfs-http-client': '1.0.0'
}
  • Platform: Linux 5.19.0-38-generic #39~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Mar 17 21:16:15 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

Severity: High

Description:

The file is broken on the addAll & wrapWithDirectory & AsyncIterable combination.
It seems to me that the first result of the yield is being ignored, and the second result is being inserted twice.

Steps to reproduce the error:

Minimal Reproduce: https://github.com/jclab-joseph/js-ipfs-bug-1

Result:

expected hash:  34b3ab5f0bf3a5c304b68fbc9e52be1263087734b6a7b2bdc185647eb402c1b4
{
  path: '1.txt',
  cid: CID(QmYWgUMxqX64PRp3YFaTkLu4sSepgy3uHJQiLxmaJzSA9x),
  size: 8330243
}
{
  path: '2.txt',
  cid: CID(QmSEd2vc9fSiMuR7kWJrRV56eZbzbjfMKbtBiF7WzZrWEy),
  size: 8330243
}
{
  path: '',
  cid: CID(QmRwz7KDSnKq39Bt939afCknChAfvByM5y5yrqwrgRNis8),
  size: 16660590
}
rootCid:  QmRwz7KDSnKq39Bt939afCknChAfvByM5y5yrqwrgRNis8
downloaded hash:  f3a4bad0eafa0fc1ae12bb796da3c23079ae990ade97bda59f76f685c1ae9f5e
@jclab-joseph jclab-joseph added the need/triage Needs initial labeling and prioritization label Apr 20, 2023
@welcome
Copy link

welcome bot commented Apr 20, 2023

Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment.
Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:

  • "Priority" labels will show how urgent this is for the team.
  • "Status" labels will show if this is ready to be worked on, blocked, or in progress.
  • "Need" labels will indicate if additional input or analysis is required.

Finally, remember to use https://discuss.ipfs.io if you just need general support.

@jclab-joseph jclab-joseph changed the title File breaks when using AsyncIterable in addAll . The file is broken when using AsyncIterable in addAll . Apr 20, 2023
@SgtPooki SgtPooki added kind/unknown-in-helia and removed need/triage Needs initial labeling and prioritization labels May 16, 2023
@SgtPooki
Copy link
Member

SgtPooki commented May 16, 2023

Hello @jclab-joseph,

js-ipfs is being deprecated in favor of Helia. You can learn more about this deprecation and the corresponding migration guide here.

As a result, we are going to close this issue. If you think we have done this in error, please feel to reopen with any comments in the next week as we will circle back on the reopened issues.

We hope you will consider Helia for your IPFS in JS needs. If you believe this particular request belongs in Helia, feel free to open a Helia issue. We look forward to engaging with you more there.

Specifically, you will want to look into @helia/unixfs for the .add, .addAll and other similar functionality. Specifically mentioned in our migration guide at https://github.com/ipfs/helia/wiki/Migrating-from-js-IPFS#files

Thanks,
@ipfs/helia-dev

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
Status: Done
Development

No branches or pull requests

2 participants