Repository navigation
telegram: notify when a hash check finds a complete torrent incomplete - #3532
Merged
Merged
Conversation
When a hash check finds that a complete torrent's data is missing or damaged, rTorrent stops the torrent and sets its message to "Download registered as completed, but hash check returned unfinished chunks." The user only sees it in the web UI. A "Check failed" event, off by default, now sends a notification then. With rTorrent 0.9.8 and 0.16.20, neither hash_failed nor hash_final_failed runs in that case. rTorrent runs hash_done after every check, including the one of each torrent it loads. The handler tests d.complete and d.message in rTorrent itself (branch, and, not, match), so a check that passes starts no process; only a failed one runs enqueue.sh.
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.
Follows #3530. Adds a "Check failed" event, off by default (a fourth row in the plugin's settings).
When a hash check finds that a complete torrent's data is missing or damaged, rTorrent stops the torrent and sets its message to
Download registered as completed, but hash check returned unfinished chunks.The user only sees that in the web UI. With rTorrent 0.9.8 and 0.16.20, neitherhash_failednorhash_final_failedruns in that case, onlyhash_done.hash_doneruns after every check, including the one of each torrent rTorrent loads. So rTorrent tests the condition itself, and a check that passes starts no process:Limits:
Testing
TelegramTest.php: 39 methods (36 before).php-test.shon PHP 7.4, 8.1, 8.5 and 32-bit 7.4: 212 files, 0 failures. Jest, PHP-CS-Fixer 3.95.27, PHPStan 2.2.9, eslint and shellcheck report nothing.In containers, with rTorrent 0.9.8 (file limit 500000) and 0.16.20 and a fake Bot API: a Force recheck of an intact torrent and of one with a changed byte. It gave one "Check failed" message, for the damaged torrent, and nothing for the intact one.
hash_doneran 6 times (4 loads, 2 rechecks) and startedenqueue.shonce.With the template
Check failed! {TORRENT}\nsize {SIZE} | label {LABEL} | ratio {RATIO}:Prepared with the help of an AI assistant.