-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix different info-hashes for uploaded and downloaded torrents #286
Merged
josecelano
merged 3 commits into
torrust:develop
from
josecelano:issue-282-fix-different-info-hash-due-to-private-field
Sep 13, 2023
Merged
Fix different info-hashes for uploaded and downloaded torrents #286
josecelano
merged 3 commits into
torrust:develop
from
josecelano:issue-282-fix-different-info-hash-due-to-private-field
Sep 13, 2023
Conversation
This file contains 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
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.
josecelano
had a problem deploying
to
coverage
September 13, 2023 13:11
— with
GitHub Actions
Failure
josecelano
had a problem deploying
to
coverage
September 13, 2023 13:13
— with
GitHub Actions
Failure
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 |
ACK d7cc040 |
4 tasks
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
private
field in theinfo
dictionary. The Index always includes that field in the response because it always stores aTRUE
orFALSE
value in the database, even when the field is not in the original torrent file.private
toNULL
when not in the original torrent. And do not include it in the response when it'sNULL
in the database.e2e::web::api::v1::contexts::torrent::asserts::expected_torrent
function to compare the info-hashes.