-
Notifications
You must be signed in to change notification settings - Fork 124
Conversation
js/src/miscellaneous/resolve.js
Outdated
ipfs.resolve(path, (err, path) => { | ||
expect(err).to.exist() | ||
expect(err.message).to.equal('found non-link at given path') | ||
const path = `/ipld/${cid.toBaseEncodedString()}/path/to/file` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK js-ipfs doesn't support /ipld
paths (please tell me I'm wrong). This is probably going to be painful to fix, and blocking go-ipfs release on this is less than ideal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're probaly not wrong.
@Stebalien why is it useful for it to partially resolve a path? Could we implement this as an option If we want to merge this, we should have a PR ready for go-ipfs/js-ipfs (or both) as well so that we know the test works! |
This does fully resolve the path. It's just that some paths stop in the middle of objects, not at object boundaries. (really, that's why this command returns a path, not a CID). |
Go-ipfs PR: ipfs/kubo#5704 |
4c3f965
to
d9722a5
Compare
1. This is an IPLD path. 2. Resolve really should be resolving up to the last path, not just "failing".
License: MIT Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
d9722a5
to
457787c
Compare
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>
Neither js-ipfs nor go-ipfs pass this test. However, IMO, a PR is the easiest way to highlight this issue. Thoughts? Objections?