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

The resolve command should work even if the path ends in the middle of an object #1763

Closed
Stebalien opened this issue Dec 8, 2018 · 2 comments · Fixed by #1841
Closed

The resolve command should work even if the path ends in the middle of an object #1763

Stebalien opened this issue Dec 8, 2018 · 2 comments · Fixed by #1841
Labels
exp/novice Someone with a little familiarity can pick up P2 Medium: Good to have, but can wait until someone steps up

Comments

@Stebalien
Copy link
Member

Being able to path into objects, not just to objects is a crucial feature of IPLD.

Given:

b = {"c": "some value"}
a = {"b": {"/": cidOf(b) }}

ipfs resolve /ipld/cidOf(a)/b/c should return /ipld/cidOf(b)/c. That is, it should resolve the path as much as it can.

Currently, this simply fails with an error.

See: ipfs/kubo#5704

@daviddias daviddias added the status/ready Ready to be worked label Dec 9, 2018
@alanshaw
Copy link
Member

Yep agree!

@alanshaw alanshaw added exp/novice Someone with a little familiarity can pick up P2 Medium: Good to have, but can wait until someone steps up labels Dec 10, 2018
@Stebalien
Copy link
Member Author

Wait. It looks like js-ipfs doesn't implement this command at all, is that right? In that case, can we just merge ipfs-inactive/interface-js-ipfs-core#385 and ipfs/kubo#5704?

@ghost ghost removed the status/ready Ready to be worked label Feb 19, 2019
alanshaw pushed a commit that referenced this issue Feb 19, 2019
refs ipfs-inactive/interface-js-ipfs-core#385
resolves #1763

BREAKING CHANGE: `ipfs.resolve` now supports resolving to the middle of an IPLD block instead of erroring.

Given:

```js
b = {"c": "some value"}
a = {"b": {"/": cidOf(b) }}
```

`ipfs resolve /ipld/cidOf(a)/b/c` should return `/ipld/cidOf(b)/c`. That is, it resolves the path as much as it can.

Previously it would simply fail with an error.

License: MIT
Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
exp/novice Someone with a little familiarity can pick up P2 Medium: Good to have, but can wait until someone steps up
Projects
None yet
3 participants