Closed veloman-yunkan closed 3 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
b2ae1d6
) 39.36% compared to head (ebf0fe8
) 39.42%. Report is 1 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
This change is sufficient to fix the bugs described in https://github.com/kiwix/libkiwix/issues/1050 without any changes in kiwix-desktop. However I am not sure that it is the right way to do that - maybe adding a removeDownload() function to kiwix::Downloader (and thus fixing https://github.com/kiwix/libkiwix/issues/1050) is justified in any case.
How aria2's addUri
behaves if we had two downloads with the same uri/options ?
addUri documentation tells nothing about that, but we need to know. I think it is necessary to remove you doubts (and mines) about this solution.
I feel a bit unconfident about simply remove this check (even if I agree with you description).
@veloman-yunkan What is the status of this PR? Does last comment of @mgautierfr has triggered a difficulty?
@veloman-yunkan What is the status of this PR? Does last comment of @mgautierfr has triggered a difficulty?
@kelson42 No additional technical difficulties. As I wrote in the description I was not sure that the proposed change was a good idea and @mgautierfr's feedback was along the same lines. Yet I will keep it open for a while until I decide how to proceed.
I started working on an alternative solution based on introducing a new method Downloader::forgetDownload()
but didn't like it early in the process and ended up with #1066. Now we have to decide which way to go.
I started working on an alternative solution based on introducing a new method Downloader::forgetDownload() but didn't like it early in the process and ended up with https://github.com/kiwix/libkiwix/pull/1066. Now we have to decide which way to go.
I like better #1066. At least we are "sure" that aria2 will not misbehave when we have two downloads for the same file/option.
@veloman-yunkan What is the status of this PR? Does last comment of @mgautierfr has triggered a difficulty?
@kelson42 No additional technical difficulties. As I wrote in the description I was not sure that the proposed change was a good idea and @mgautierfr's feedback was along the same lines. Yet I will keep it open for a while until I decide how to proceed.
OK, it seems an alternative has been chosen, but the two issues this PR was going to fix are still open:
So not sure if this PR should be revamped, a new PR started or just the two issue to be closed...
Fixes kiwix/kiwix-desktop#1022 (as well as the other case described in #1050 without fixing the latter)
Before this change
Downloader::startDownload()
might avoid starting a new download when a download with the specified URI was already present in its cache. This might be confusing for the following reasons:uri is not the only parameter of
Downloader::startDownload()
- a target download directory may also be specified through the secondoptions
parameter. Thus callingDownloader::startDownload()
twice with the same URI but different download directories would not save files into the second directory.Files of a completed download may be removed, whereupon downloading the same files again won't be a no-op. However in such a situation
Downloader
refuses to actually repeat a previous download.This change is sufficient to fix the bugs described in #1050 without any changes in
kiwix-desktop
. However I am not sure that it is the right way to do that - maybe adding aremoveDownload()
function tokiwix::Downloader
(and thus fixing #1050) is justified in any case.