-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Conversation
Depends on ipfs/js-ipfs-repo#140 |
@pgte please run |
@diasdavid tested and it runs locally, but first you need to link these to the respective branches:
|
src/core/components/config.js
Outdated
@@ -15,23 +12,9 @@ module.exports = function config (self) { | |||
|
|||
if (!key) { | |||
return self._repo.config.get(callback) | |||
} else { | |||
return self._repo.config.get(key, callback) |
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.
Doesn't the IPFS repo figure this out by itself now?
src/core/components/config.js
Outdated
@@ -42,13 +25,7 @@ module.exports = function config (self) { | |||
return callback(new Error('Invalid value type')) | |||
} |
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.
Isn't this validation happening inside the repo itself?
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.
It should. ipfs/js-ipfs-repo#140 supports this now (via ipfs/js-ipfs-repo@8e8055d).
Fixed.
1172e6a
to
5de743a
Compare
@pgte tests fail because of:
Wasn't this change supposed to be contemplated in the awesome endeavor? |
@diasdavid I hadn't included this change in the awesome endeavour, it was in a separate PR which wasn't listed here, I didn't think you would merge it as part of this. |
* feat: adapted to new ipfs-repo API
BREAKING CHANGE. Previously swarm.peers would throw an uncaught error if any peer in the reponse could have its peerId or multiaddr validated. This PR catches errors that occur while validating the peer info. The returned array will contain an entry for every peer in the ipfs response. peer-info objects that couldn't be validated, now have an `error` property and a `rawPeerInfo` property. This at least means the count of peers in the response will be accurate, and there the info is available to the caller. This means that callers now have to deal with peer-info objects that may not have a `peer or `addr` property. Adds `nock` tests to exercice the code under different error conditions. Doing so uncovered a bug in our legacy go-ipfs <= 0.4.4 peer info parsing, which is also fixed. The code was trying to decapusalate the peerId from the multiaddr, but doing so trims the peerId rather than returning it. fixes ipfs#885 License: MIT Signed-off-by: Oli Evans <oli@tableflip.io>
ipfs-repo dependents are: