Page 1 of 1

Dataloss bugs/Order of Operation REMOVED

Posted: Sun Mar 13, 2016 10:42 am
by KitKat
Qbittorent appends .!qb extension AFTER creating the file resulting in existing files with the same name been overwritten THEN renamed.

This issue makes downloading, for example a complete season torrent into the same folder as some partial episodes, cause dataloss even if the already existing files are marked as skip (due to shared pieces)  Checking the "add !qb extenstion" option does not mitigate this issue because qbittorent creates filename.mp4 THEN renames it to filename.mp4.!qb causing an (accidental i hope) overwrite operation when the file initially is created, further it also creates the unwanted file THEN moves it (leads to the shared pieces overwrite issue)

Qbittorent fails to properly handle files it creates when a file with the same name already exist on the disc in the payload directory WHEN the existing file doesnt match the metadata for the file qbittorent wants to download.

This should throw an I/O error and notify the user a file already exists and cause the torrent to error.
What it does instead is overwrite the existing file on the disc with the file in torrent with no notification to the user.

Extra files/folders added or created in a torrent subdirectory that is moved by qbittorent are also atomically moved.

Eg. I have a torrent with a single folder + single file structure like so "isos/archlinux.iso" i save it to the root folder Z:
I download more files into the "isos" folder using qbittorent or simply move files into it, then using qbittorent i rename the "isos" folder or change the "Set download location" for isos/archlinux.iso.
Everything else (unrelated) inside of the "isos" folder moves along with it, if some of those files are locked files (eg in use seeding torrent files) this creates some interesting issues in qbittorent regarding torrent saved path data (weird locational branches).

All bugs tested against stable release 3.3.3 on a windows 10 VM & a debian host system.

Re: Dataloss bugs/Order of Operation REMOVED

Posted: Tue Mar 15, 2016 2:41 pm
by ciaobaby
Two payloads in ONE folder CANNOT 'share' file names, so existing files with the same names WILL BE OVERWRITTEN by necessity this is not a 'bug', fault or whatever,  it IS totally and absolutely user error.


The !qB extension is added after the file has been created simply because it cannot add it before the file exists, the files in the payload are allocated with the names from the metadata which does not have any mechanism to add additional extensions before 'storage allocation'.
This should throw an I/O error and notify the user a file already exists and cause the torrent to error
libtorrent is not a file manager, it is a bittorrent protocol engine and as such does not handle 'files'.

Re: Dataloss bugs/Order of Operation REMOVED

Posted: Wed Mar 16, 2016 11:06 pm
by KitKat
[quote="ciaobaby"]
Two payloads in ONE folder CANNOT 'share' file names, so existing files with the same names WILL BE OVERWRITTEN by necessity this is not a 'bug', fault or whatever,  it IS totally and absolutely user error.
[/quote]
Figured as much, was just mentioning it due to the payload overwrite on files specified as unwanted due to the !qB extension fault/issue
This issue has actually been mentioned on github and would accidentally occur in normal use.

[quote="ciaobaby"]
The !qB extension is added after the file has been created simply because it cannot add it before the file exists, the files in the payload are allocated with the names from the metadata which does not have any mechanism to add additional extensions before 'storage allocation'.
[/quote]
Possibly do a casewhere IF append !qB extension = 1 save the payload initially to the qb appdata/working folder then rename it and relocate it to the user specified save location then proceed with the download as normal.

[quote="ciaobaby"]
libtorrent is not a file manager, it is a bittorrent protocol engine and as such does not handle 'files'.
[/quote]
Fair enough.