-
Notifications
You must be signed in to change notification settings - Fork 20
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
feat: [#261] store original info-hashes #269
feat: [#261] store original info-hashes #269
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #269 +/- ##
===========================================
- Coverage 44.73% 43.65% -1.09%
===========================================
Files 77 77
Lines 4124 4240 +116
===========================================
+ Hits 1845 1851 +6
- Misses 2279 2389 +110
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Good Work @josecelano One thing: I suggest that we rename the |
Thank you!. And that's a good suggestion! I still have to finish some pending tasks.
Regarding the naming, I'm not sure at all. Do you like these terms: original and canonical? I do not like the table name: Current
New Cameron's proposal
New Jose's proposal
I can't come up with a better name for the table. The one that describes it well is These are three proposals from ChatGPT:
For all the torrents that share the same canonical infohash. Finally, notice that I have not added a record, as you originally proposed, with the original and canonical infohases being the same. If you upload a torrent the first time which has a different original and canonical infohashes, only one record will be created. I thought it would be simpler, you only have one record per original infohash. Notice that the primary key is only the original infohash and not the pair original/canonical. |
|
Integration tests fail because there is a new container image for the Tracker. I'm working on a new PR to fix it. |
When you upload a torrent, the infohash might change if the `info` dictionary contains non-standard fields because we remove them. That leads to a different infohash. We store the original infohash in a new table so that we can know if the torrent was previously uploaded. If we do not store the original infohash we could reject uploads producing the same canonical infohash. Still, there is no way for the user to ask if a torrent exists with a given original infohash. They only would be able to interact with the API with the canonical infohash. Sometimes it's useful to use the original infohash, for instance, if you are importing torrents from an external source and you want to check if the original torrent (with the original infohash) was already uploaded.
I've created a new epic issue to track all changes related to canonical info-hashes. |
…ical infohash If you upload a torrent, the infohash migth change if the `info` dictionary contains custom fields. The Index removes non-standard custom fields, and that generates a new infohash for the torrent. If you upload a second torrent which is different from a previous one only in the custom fields, the same canonical infohash will be generated, so the torrent will be rejected as duplicated. The new original infohash will be stored in the database.
ACK 110e159 |
When you upload a torrent, the infohash might change if the
info
dictionary contains non-standard fields because we remove them. That leads to a different infohash. We store theoriginal infohash in a new table so that we can know if the torrent was previously uploaded.
If we do not store the original infohash we could reject uploads producing the same canonical infohash. Still, there is no way for the user to ask if a torrent exists with a given original infohash. They only would be able to interact with the API with the canonical infohash.
Sometimes it's useful to use the original infohash, for instance, if you are importing torrents from an external source and you want to check if the original torrent (with the original infohash) was already uploaded.