-
Notifications
You must be signed in to change notification settings - Fork 1.2k
dag.resolve has different return type in http-client #2962
Comments
I can take this up. Would we want PS: Might need some help as I'm new to the community. |
It returns an async iterator because we can use it to resolve deeply nested paths inside DAGs - we may end up traversing to other nodes in which case we yield the intermediate nodes along the way. If I'm honest I don't know how useful this is. The HTTP API also only returns the last result so although it'd be good for the HTTP API client and the core to be consistent, the API client is limited by what the HTTP API will return, so it might be better to just change the core to return the last result instead of the iterator as the HTTP API client has no way of returning the intermediate nodes. This is easily done by changing the function signature & taking the logic from the http api endpoint and moving it into the core api function (n.b. it should still return There should be interface tests for
So, to land this:
|
@achingbrain Thanks for the write-up. Based on how you have explained, using So I'll start work on the pointers you mentioned. Thanks. |
Makes `ipfs.dag.resolve` behave the same when calling into core and over the http api. Adds documentation and interface tests for `ipfs.dag.resolve`. Supersedes #3131 Fixes #2962 BREAKING CHANGES: - `ipfs.dag.resolve` returns `Promise<{ cid, remainderPath }` instead of `AsyncIterator<{ value, remainderPath }>` - Previously the core api returned an async iterator and the http client returned a simple promise Co-authored-by: Tarun Batra <[email protected]>
Makes `ipfs.dag.resolve` behave the same when calling into core and over the http api. Adds documentation and interface tests for `ipfs.dag.resolve`. Supersedes #3131 Fixes #2962 BREAKING CHANGES: - `ipfs.dag.resolve` returns `Promise<{ cid, remainderPath }` instead of `AsyncIterator<{ value, remainderPath }>` - Previously the core api returned an async iterator and the http client returned a simple promise Co-authored-by: Tarun Batra <[email protected]>
In
ipfs-http-client
it returnsPromise<{ cid: CID, remPath: string }>
but inipfs
it returnsAsyncIterable<{ value: CID|any, remainderPath: string }>
The text was updated successfully, but these errors were encountered: