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

fix: do not abort dht operation on error responses #3001

Merged
merged 2 commits into from
Apr 27, 2020

Conversation

achingbrain
Copy link
Member

@achingbrain achingbrain commented Apr 24, 2020

Response streams from DHT operations contain lots of message types, one of which is 'Error', but they are emitted for all sorts of reasons, failing to dial peers, etc and valid responses can arrive after several errors.

The change here is to ignore error messages sent by the remote node as they do not indicate that the request has failed.

Fixes #2991

Response streams from DHT operations contain lots of message types, one
of which is 'Error', but they are emitted for all sorts of reasons, failing
to dial peers, etc and valid responses can arrive after several errors.

The change here is to ignore error messages sent by the remote node as
they do not indicate that the request has failed.

It also makes the response types consistent in that previously we only
turned some peer IDs into CIDs, now they are all CIDs all the time.

Fixes #2991
@alanshaw
Copy link
Member

alanshaw commented Apr 24, 2020

Just checking, I was under the impression all Peer IDs were strings atm?

@achingbrain
Copy link
Member Author

Good point, I've updated the PR

@phillmac
Copy link
Contributor

LGTM 👍

@achingbrain achingbrain merged commit a69f782 into master Apr 27, 2020
@achingbrain achingbrain deleted the fix/do-not-abort-dht-operations-on-error branch April 27, 2020 11:58
SgtPooki referenced this pull request in ipfs/js-kubo-rpc-client Aug 18, 2022
Response streams from DHT operations contain lots of message types, one of which is 'Error', but they are emitted for all sorts of reasons, failing to dial peers, etc and valid responses can arrive after several errors.

The change here is to ignore error messages sent by the remote node as they do not indicate that the request has failed.

Fixes #2991
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ipfs-http-client dht functions throw exceptions too early
3 participants