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
Transmission "cache cleaning" is wrong #46
Comments
blocklist directory could contain non .bin manually added user files and there would be no method of determining specifically which the user might not want for future editing and production of the resulting liked named .bin. A file named blocklist.bin is produced from a valid blocklist url but even so we still don't know if the user renamed a different .bin to this for whatever reason. Summed up I don't see how to safely remove anything from the blocklist directory other than parsed files which produced no valid results and .bin but this is not something XML could possibly determine. There was an issue with blocklist.tmp (actually a file descriptor) being leaked but it's been fixed. resume files could be safely cleaned if no exactly like named torrent file was found. As mikedld proposes, this needs to be fixed or the cleaner removed. |
In regards to bleachbit#46 As you've both pointed out, since fixing this might be tricky from a technical standpoint, how about we relabel the options so users can make there own informed decisions? Would this patch be ok?
As you've both pointed out, since fixing this might be tricky from a technical standpoint, how about we relabel the options so users can make their own informed decisions? Would the above patch be ok? |
I think that would be OK if we changed: and "Remove all torrents" to "Remove all torrents (associated data will remain)" The user needs to be informed of the final results detail. |
What's the associated data that will remain? Keep in mind that we want the wording to be succinct, so there will be less work for translators. |
The data that remains is the torrent's downloaded and/or seed data. Transmission clients, for instance the web client, use wording like this when removing torrent(s): "Remove from list" I think that it should be clear that the associated torrent data is not being removed as well. |
And the seed data would be |
No, what I meant was the actual files downloaded or the actual files supplied by the user to seed/upload. The files associated with the .torrent and .resume files don't always have to be downloaded but can also be user supplied and therefore seeded/uploaded. The stats file is overall stats for the application as a whole and I don't know why that should be deleted. |
Ok, how about ^that^ |
Looks fine to me :) |
oops, I think I might have done something wrong when I was testing the cleaner. For some reason after deleting the blocklists, my blocklist settings where also reset to defaults (enable/disable state for using blocklists, url for the list, enable/disable state for automatic updates), which doesn't make sense because those seem to be stored in |
"Blocklists will need update to work. That works for me. |
Fixed the warning and sent a pull request |
Yes, thank you. :) |
Blocklists directory could contain a cached blocklist file corresponding to one downloaded from single URL provided in settings. The file Transmission uses to store cached blocklist in this case is "[config dir]/blocklists/blocklist.bin". However, this directory could also contain additional blocklist files put there manually by user; those files are either already in the format used by Transmission for blocklist cache (in which case they should have ".bin" extension) or in the format that Transmission is able to parse (in which case they should not have ".bin" extension and Transmission will parse and create/update cache files named "[config dir]/blocklists/[original file base name].bin" during initialization, or on SIGHUP if transmission-daemon is used). The issue is, both ".bin" and non-".bin" files are being removed, while only the former are considered "cache" (and even then, some of those could be user-provided).
Resume directory, if managed solely by Transmission without user's intervention, could only contain files with ".resume" extension. Those files are used to track torrent download/seed progress/statistics, current files location (complete and incomplete files could be stored in different directories on per-torrent basis), file download priorities and "do not download" flags, bandwidth/seeding limits overrides, paused state, real file names on disk (in case any files/directories inside torrent were renamed by user). As you could see, none of this information could be considered "cache". Each ".resume" file though should have a corresponding ".torrent" file in "[config dir]/torrents" directory (with matching base name); and only those ".resume" files which do not have corresponding ".torrent" files could be safely removed.
I see cleaners are simple XML files, while they used to be implemented in Python. I would've made a pull request right away if they still were in Python, but I suppose this XML description format doesn't provide what's necessary for a proper cleaning implementation (correct me if I'm wrong). Thus I propose you to either fix Transmission cleaning (if that's possible) or remove this cleaner.
The text was updated successfully, but these errors were encountered: