Skip to content
This repository has been archived by the owner on Apr 29, 2020. It is now read-only.

Added object patch subcommands #68

Merged
merged 3 commits into from
Apr 19, 2016
Merged

Added object patch subcommands #68

merged 3 commits into from
Apr 19, 2016

Conversation

RichardLitt
Copy link
Contributor

This closes #32, if #67 is also merged. Opened in new PR because rebasing is hell.

```
{
"Hash": "Qmd286K6pohQcTKYqnS1YhWrCiS4gz7Xi34sdwMe9USZ7u",
"Links": null

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are Links supposed to be always null on this endpoint?
ipfs object links returns 2 links for this Hash, for example:

➜  js-ipfs git:(master) ✗ ipfs object links Qmd286K6pohQcTKYqnS1YhWrCiS4gz7Xi34sdwMe9USZ7u
QmPEKipMh6LsXzvtLxunSPP7ZsBM8y9xQ2SQQwBXy5UY6e 262158
QmT8onRUfPgvkoPMdMvCHPYxh98iKCfFkBYM1ufYpnkHJn 181100

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure. @whyrusleeping?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is for ipfs object patch append-data ? I have no idea why it would be returning Links... seems wrong

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing it. Opened ipfs/kubo#2589.

"Hash": "QmSt5pTDuoZ5xi1iqroo8W57Fvp4U23h5gXfj6X7rWLcbn",
"Links": null
}
```

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this a bug as well? Isn't the third arg required?

BTW, I tried running this locally and I'm getting the same behaviour as the Request With Invalid Third Argument (There is no response: the request hangs.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@diasdavid Do you have any idea?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(let's see if I managed to jump into the same context where your heads are)

So for this req:

curl -i -X POST "http://localhost:5001/api/v0/object/patch/add-link?arg=QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn&arg=foo&arg=

We are adding to the MerkleDAG object, which multihash is "QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn", a link with key "foo" and value "".

There isn't really anything wrong with adding empty links, other than it is worthless from the practical standpoint. Nevertheless, pointing to null is a valid pointer and it should not hang nor crash.

Did I answer your question?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suitable for me. This works.

@daviddias
Copy link
Contributor

It says it closes #32, but #32 is still open. Which PR should we review?

@RichardLitt
Copy link
Contributor Author

@diasdavid not #32. That's a wontfix. Review this and #67.

@RichardLitt RichardLitt merged commit a8af99e into master Apr 19, 2016
@RichardLitt RichardLitt deleted the feature/object-patch branch April 19, 2016 19:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants