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

ipfs.object.links result not match doc of ipfs.object.patch.rmLink argv #3815

Closed
bluelovers opened this issue Aug 16, 2021 · 2 comments · Fixed by #4073
Closed

ipfs.object.links result not match doc of ipfs.object.patch.rmLink argv #3815

bluelovers opened this issue Aug 16, 2021 · 2 comments · Fixed by #4073
Labels
exp/beginner Can be confidently tackled by newcomers good first issue Good issue for new contributors help wanted Seeking public contribution on this issue topic/docs Documentation

Comments

@bluelovers
Copy link
Contributor

https://github.com/ipfs/js-ipfs/blob/master/docs/core-api/OBJECT.md#ipfsobjectpatchrmlinkcid-link-options

ipfs.object.links

  {
    Name: '116',
    Tsize: 2752602,
    Hash: CID {
      code: 112,
      version: 1,
      multihash: [Digest],
      bytes: [Uint8Array]
    }
  },

ipfs.object.patch.rmLink

// cid is CID of the DAG node created by removing a link
const cid = await ipfs.object.patch.rmLink(node, {
  name: 'some-link',
  size: 10,
  cid: CID.parse('QmPTkMuuL6PD8L2SwTwbcs1NPg14U8mRzerB1ZrrBrkSDD')
})
@bluelovers bluelovers added the need/triage Needs initial labeling and prioritization label Aug 16, 2021
@bluelovers bluelovers changed the title ipfs.object.links result not match ipfs.object.patch.rmLink argv ipfs.object.links result not match doc of ipfs.object.patch.rmLink argv Aug 16, 2021
@lidel
Copy link
Member

lidel commented Oct 8, 2021

@bluelovers is this about confusion from the fields names in response format being different?
Do you want to open a PR that updates the docs to make return type of ipfs.object.links more clear?

@lidel lidel added need/author-input Needs input from the original author topic/docs Documentation and removed need/triage Needs initial labeling and prioritization labels Oct 8, 2021
@lidel lidel added good first issue Good issue for new contributors exp/beginner Can be confidently tackled by newcomers help wanted Seeking public contribution on this issue and removed need/author-input Needs input from the original author labels Nov 19, 2021
@amandesai01
Copy link

I am willing to fix this. Just to confirm, given example:

// cid is CID of the DAG node created by removing a link
const cid = await ipfs.object.patch.rmLink(node, {
  name: 'some-link',
  size: 10,
  cid: CID.parse('QmPTkMuuL6PD8L2SwTwbcs1NPg14U8mRzerB1ZrrBrkSDD')
})

should be something like this:

// cid is CID of the DAG node created by removing a link
const cid = await ipfs.object.patch.rmLink(node, {
  Name: 'some-link',
  Tsize: 10,
  Hash: CID.parse('QmPTkMuuL6PD8L2SwTwbcs1NPg14U8mRzerB1ZrrBrkSDD')
})

Correct?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
exp/beginner Can be confidently tackled by newcomers good first issue Good issue for new contributors help wanted Seeking public contribution on this issue topic/docs Documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants