fixed initial progress error during resume, after multiple pause resumes #13
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.
progress error · Issue #12 · nabil6391/flutter_download_manager
Problem:
The task was paused first, then resumed, repeated several times, and the initial progress was found to be wrong when resumed。Restoration progress will start from partialFile.length()
Reason:
The reason is that the current progress is not written to the partialFile during the pause。
Is the condition task.status.value == DownloadStatus.paused too broad? , or should add e instanceof CancelToken? If dio.download throws other exceptions, it seems that keeping the downloaded content is also feasible. Here we need to discuss the scope of conditions