fix(iroh::downloader
): remove hash from providers
in two missed cases
#1584
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
We weren't removing the hash of a request that was scheduled, became ready but couldn't be executed. This caused getting the next hash for a provider to pop a hash no longer necessary.
I added an invariant check for the provider map and it seems to be we missed a couple removals in #1480 so this fixes removal in cancellation as well
Notes & open questions
one small change, seemingly unrelated, is that the
debug_assert
now uses the debug version of the hash instead of display. This is because throughout the file we log the kind in debug, which in turn uses the debug impl for the hash. This difference made it a bit harder to follow the logs because the printed hash didn't match those in the rest of the logs. The change makes this consistentChange checklist