-
Notifications
You must be signed in to change notification settings - Fork 1.2k
ipfs-core: dag.get does not return nested CID data #3957
Comments
Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
Finally, remember to use https://discuss.ipfs.io if you just need general support. |
This needs to be revisited after #3917 |
Looks like this behaviour changed with #3556 - the migration from ipld to multiformats. The difference is the old ipld codecs used to implement traversal, the new versions do not. At the IPFS level traversal is implemented by stepping through the properties of deserialized objects (with I think in this case if there's a value we've loaded that hasn't been yielded, it's reasonable to yield it after leaving the while loop, so this is probably a bug. |
If we're traversing thorough and object and the thing at the end of the path is a CID, load that thing and return it as the final value. Fixes #3957
If we're traversing thorough and object and the thing at the end of the path is a CID, load that thing and return it as the final value, unless `localResolve` is true, in which case return the CID. Fixes #3957
If we're traversing thorough and object and the thing at the end of the path is a CID, load that thing and return it as the final value, unless `localResolve` is true, in which case return the CID. Fixes #3957
Version: ipfs-core 0.12.2
Severity:
High - The main functionality of the application does not work, API breakage, repo format breakage, etc.
Description:
We are currently upgrading to the latest versions of ipfs-related packages. We found that ipfs-core may have an issue with
dag.get
.If we put JSON-like data on an IPFS node using
dag.put
, and this data contains a key that corresponds to a valid CID (nestedCID), when we get that data usingdag.get
and a path to that key, the nestedCID is returned instead of the data contained at the nestedCID.This is not consistent with ipfs-core v0.7, where the data stored at the nestedCID is returned.
Is returning the nestedCID the desired behavior?
I also noticed that the nestedCID data is retrieved here:
js-ipfs/packages/ipfs-core/src/utils.js
Line 248 in 6178708
yield
is not called with this data. If yield is called with this data, the data is returned.Steps to reproduce the error:
This issue is demonstrated here: https://github.com/stephhuynh18/ipfs-dag-get-issue
CC @ukstv
The text was updated successfully, but these errors were encountered: