Fix different info-hashes for uploaded and downloaded torrents#286
Merged
josecelano merged 3 commits intotorrust:developfrom Sep 13, 2023
josecelano:issue-282-fix-different-info-hash-due-to-private-field
Merged
Fix different info-hashes for uploaded and downloaded torrents#286josecelano merged 3 commits intotorrust:developfrom josecelano:issue-282-fix-different-info-hash-due-to-private-field
josecelano merged 3 commits intotorrust:developfrom
josecelano:issue-282-fix-different-info-hash-due-to-private-field
Conversation
The test for downloading a torrent now compares the uplaoded torrent info-hash with the downloaded one. It fails becuasse the Index adds the `private` field in the `info` dictioanry always, changing the info-hash.
NOTICE: They only matche when the index doesn't change it becuase it removs non-standard fields from the `info` key dictionary. They should match if the uploaded torrent does not have any non-stanrdard field in the `info` dictionary key.
Codecov Report
@@ Coverage Diff @@
## develop #286 +/- ##
========================================
Coverage 43.65% 43.65%
========================================
Files 77 77
Lines 4240 4240
========================================
Hits 1851 1851
Misses 2389 2389
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Member
Author
|
ACK d7cc040 |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
If you upload a torrent and you download it, the downloaded torrent info-hash is not the same if the origin one didn't contain the
privatefield in theinfodictionary. The Index always includes that field in the response because it always stores aTRUEorFALSEvalue in the database, even when the field is not in the original torrent file.privatetoNULLwhen not in the original torrent. And do not include it in the response when it'sNULLin the database.e2e::web::api::v1::contexts::torrent::asserts::expected_torrentfunction to compare the info-hashes.