Repository navigation
Bump Downloader from 5.9.5 to 7.1.0 - #119
Closed
dependabot[bot] wants to merge 1 commit into
Closed
dependabot[bot] wants to merge 1 commit into
dependabot[bot] wants to merge 1 commit into
Conversation
--- updated-dependencies: - dependency-name: Downloader dependency-version: 7.1.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
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.
Updated Downloader from 5.9.5 to 7.1.0.
Release notes
Sourced from Downloader's releases.
7.1.0
Fixes for the 2 critical and 3 high issues of the 7.0.1 review. No public API is removed.
🐛 Fixes
CancelTaskAsync()then waited for ever too. Now a storage error is a newStorageException(anIOException). It is not retried: the download fails at once.DownloadFileCompletedwas never raised, and a memory download with missing bytes said Completed. Now the work is done first and the status is set last: if it fails, the status is Failed and the event comes once with the error. The file is always closed.Dispose()and the next download hang for ever. For example aContent-Typeheader inRequestConfiguration.Headers, or aCustomHttpClientFactorythat throws. The caller still gets the exception, but the status is Failed now (not Created), so the service can be disposed and used again.DownloadPackagecould give a broken file that said Completed. If the.downloadfile was deleted or cut, or the file on the server changed (size,ETagorLast-Modified), the old chunk positions were used. Now the download starts from zero in these cases..downloadfile, and in the end no file was left. Now only one download in the process can write a temp file: withFileExistPolicy.Renamethe second one gets another name, otherwise it fails at once with anIOException. A download that was just stopped is not counted: Stop and then Start on the same file works, and a retry started fromDownloadFileCompletedgets the file. A resume from aDownloadPackageholds its temp file in the same way.ClearPackageOnCompletionWithFailure = true, the finished.downloadfile was deleted when only the rename to the final name failed. Now it is kept.🔄 Changed
ConcurrentStream.FlushAsync()throws aStorageExceptionafter a write error (it threw anAggregateException).What's Changed
Full Changelog: bezzad/Downloader@v7.0.2...v7.1.0
7.0.2
🐛 Fixes
FlushAsyncis a real flush while a download runs (#259). Before, it waited until the write queue was empty. While chunks write faster than the disk, the queue is never empty, so the flush did not end. Now it waits only for the blocks given before the call, then flushes the file to the disk (FileStream.Flush(true), not only to the OS cache). The flush runs on the writer task, so it never runs at the same time as a write. When the stream is closed before the flush ends,FlushAsyncthrowsObjectDisposedExceptioninstead of reporting dropped bytes as written. The 20 ms wait after each flush is gone.await package.FlushAsync(), then save the bytes. The saved chunk positions then never count bytes that are not on the disk.What's Changed
Full Changelog: bezzad/Downloader@v7.0.1...v7.0.2
7.0.1
🐛 Fixes
/(on Windows, the drive letter), so a download to another mount was checked against the wrong free space. In a Snap or Flatpak sandbox,/is a small private mount, so a 21.7 GB download into~/Downloadsfailed with "not enough space" while/homehad 145 GB free. Now the check finds the file system that really holds the target folder: it follows symbolic links, uses the nearest folder that exists, and picks the longest matching mount (a separate/home,/media/*USB drives, NFS, Docker volumes, sandboxes).TotalFileSize - ReceivedBytesSize.Not enough disk space for '<file>': needs <N> more bytes, <F> bytes free on '<mount>'.It is still anIOException.Full Changelog: bezzad/Downloader@v7.0.0...v7.0.1
7.0.0
Progress events are now raised one call at a time, in order (#256). It has breaking changes (marked BREAKING below), so the major version goes up.
🔄 Changed
DownloadProgressChangedis raised one call at a time, in order (#256). Before, every chunk thread raised it, so with a parallel download the handler ran on several threads at once, an older total could arrive after a newer one, and Rx observers broke. Now the storage writer reports the bytes it has written, and one deliverer on the thread pool raises the event. The download never waits for the handler: a slow handler gets merged updates (ProgressedByteSizeis the sum since the last one), and the last update can arrive afterDownloadFileCompleted. A handler that throws is logged and the download goes on.ChunkDownloadProgressChangeddoes not change: it still runs on each chunk's thread, so use it if you must stop a download at an exact point.EnableLiveStreaming = truethe download uses one connection, soReceivedBytescomes in file order, and every block reaches the handler. When the waiting blocks passMaximumMemoryBufferBytes, the download waits for the handler (0= no limit).EnableLiveStreamingcan not change while a download runs. Setting it to a new value then throws anInvalidOperationException.ConcurrentStream.WriteandConcurrentStream.WriteAsyncare internal now. Only the download itself writes to its storage; these methods were public only because the class is.🐛 Fixes
MaximumMemoryBufferBytes.What's Changed
Full Changelog: bezzad/Downloader@v6.0.1...v7.0.0
6.0.1
🐛 Fixes
Pause()andResume()do nothing unless the download was Running or Paused, so aPause()while the server was still asked for the size (status None or Created) was lost and the download ran on. Now only a finished download (Completed, Failed or Stopped) ignores them.Full Changelog: bezzad/Downloader@v6.0.0...v6.0.1
6.0.0
A big safety and reliability release. It has two breaking changes (marked BREAKING below), so the major version goes up. Version 5.11.0 was never published; its fixes are part of this release.
🔒 Security
CustomHttpMessageHandlerFactory(see the README).Content-Disposition(for example../../.bashrc,/etc/xorC:\x.exe) is cleaned: only the last part is kept, and characters that are not allowed in a file name become_.filename*=UTF-8''...names are now read, andFileName=is matched without caring about case.Authorizationheader (fromRequestConfiguration.AuthorizationorCredentials) is sent only to the scheme, host and port you asked for. After a redirect to a CDN, or from https to http, it is left out.🔄 Changed
RequestConfiguration.Proxyis null. Before, no proxy was used at all, so downloads failed on networks that need one. Now the OS proxy settings (orHTTP_PROXY/HTTPS_PROXY/NO_PROXY) are used, likeHttpClientdoes. To use no proxy, setProxy = new WebProxy().🐛 Fixes
RangeDownloadfails with the newInvalidRangeResponseException.ETagandLast-Modifiedheaders are saved with the resume state (newPackageInfo.ETag/LastModified, also onRemoteFileInfo). If the server file changed but kept its size, the download starts again instead of mixing old and new bytes..downloadfiles are still read.ObjectDisposedException, the rented buffer is returned, and the packet is not left in the queue.ChunkCount,ParallelCount,ParallelDownload,RangeLow/RangeHighandCustomHttpClientFactoryback into yourDownloadConfiguration, so the next download with the same object was slow. These values are now kept per download.DownloadConfiguration.Clone()now also copiesRequestConfiguration(headers and client certificates are new lists; cookies, proxy and credentials stay shared).BlockTimeoutif that is bigger); before, it could overflow to a negative value.ParallelDownload = falsenow really uses one connection. All chunks were started at once and only waited on a semaphore ofParallelCount, so a "serial" download opened up toParallelCountconnections. Now chunki + 1starts after chunkiis done. Serial downloads can be slower if you got parallel speed by accident before.RangeHighis the last byte index, but it was clamped to the file size instead of size − 1, so the download waited for one byte that does not exist and retried for ever. A reversed range (RangeHigh < RangeLow) or aRangeLowpast the end now fails the download withArgumentOutOfRangeExceptioninstead of being changed silently.Locationworks. When the library follows a redirect by itself (for example https → http), a relativeLocationsuch as/files/a.zipthrewUriFormatException. It is now resolved against the current address.Pause(),Resume()andCancelAsync()on a Completed or Failed download changed the status to Running or Paused, andIsBusystayed true. Now they do nothing.Clear()/Dispose()right after the start (while the server is still being asked for the size) no longer waits until the whole file is downloaded.DownloadConfiguration.PropertyChangedand never unsubscribed, so reusing one configuration for many downloads kept all old chunks alive.MaximumBytesPerSecondset, a stop or cancel first waited for the throttle delay (many seconds at a low limit). The delay now ends at once when the download is cancelled.WithFileNamewithout a folder works.DownloadBuilder.New().WithUrl(url).WithFileName("a.zip")threwArgumentNullException; it now saves to that name.DownloadBuilder.Build()without a URL throwsArgumentNullExceptionwithParamName = "url"and a clear message.FileExistExceptionnow has a message that names the file.🔧 Under the hood
RequestConfiguration.ImpersonationLevel,PipelinedandUseDefaultCredentialsare now[Obsolete]: they never had an effect.DownloadFileExtensionis cleaned in one simple step (spaces removed, dots and commas trimmed, lower case);" .part "now gives.partinstead of..part.What's Changed
Full Changelog: bezzad/Downloader@v5.10.2...v6.0.0
5.10.2
A small fix for pause/resume and cancel threading.
🐛 Fixes
PauseTokenSourceand the download's completion source finished their tasks inline. SoResume()could run the paused download work on the caller's thread (for example the UI thread), and code afterawait CancelTaskAsync()could run on the download thread beforeDownloadFileCompletedwas raised. Both now useTaskCreationOptions.RunContinuationsAsynchronously.Full Changelog: bezzad/Downloader@v5.10.1...v5.10.2
5.10.1
A small fix on top of 5.10.0 for downloads that use more than one url.
🐛 Fixes
ialways uses urli % count, the same as before 5.10.0, so the load is spread over your mirrors in a stable way.5.10.0
Safer live settings, correct file size after a server error, and smarter splitting of the last chunks.
✨ New
MinimumChunkSizeis set (greater than 0), a parallel worker that has finished its own chunk can split the largest unfinished chunk and download its second half, as long as both halves stay at leastMinimumChunkSize. With the default0nothing changes. (#245, thanks @crazysmile-PhD)🐛 Fixes
Range: 0-0probe no longer switches the download to one connection; the Range probe is asked again. A transient status on the probe (503, 429, 504, 408) is retried up to 3 times instead of failing the download.MaximumBytesPerSecond,ActiveChunks,BufferBlockSizeandEnableLiveStreaminguse atomic reads and writes, so a change from another thread (like a UI speed limit) is seen by the download threads at once, andPropertyChangedfires once per real change.5.9.8
Highlights
A stop no longer leaves a
NullReferenceExceptionbehind.🐛 Fixes
CancelAsync()abandons every chunk the loop had not reached yet. Those chunks are still inside their read loops and still raise progress events, while the download has already run its terminal path — which closes the package storage and setsPackage.Storagetonull. Each progress event writes the auto-resume metadata through that storage, unguarded, so an abandoned chunk threw an NRE; when its cancellation token is no longer the one in force, that NRE becomes the download's error and reaches the consumer throughDownloadFileCompleted. The metadata write now reads the storage once and skips it when the download is over — resume metadata for a finished transfer is worthless anyway.Dispose()racing a completion could swallow the completion event entirely.Clear()nulls the internalTaskCompletionSource, and an app that releases its engine as soon as a download ends can run that concurrently with the completion signal. Reporting that a download is over no longer depends on that field still being there.ActiveChunksno longer throws when the semaphore it counts has already been disposed byClear(); a torn-down download reports no active chunks instead.DownloadPackage.FlushAsync/CloseAsyncreadStorageonce instead of check-then-use, so a flush that races a close cannot dereferencenull.🔧 Under the hood
StopRaisesNoNullReferenceTestcovers the race deterministically (it raises 7 NREs against 5.9.7 and none against this release), and an opt-in soak (RetryAfterStopStressTest, enabled withNRE_STRESS_ITERATIONS) walks stop → dispose → retry across cancel point, chunk count, parallel on/off, server variant and throttled/instant.Math.Max.Found from a download manager whose retried-after-stop row was shown as failed even though the file was complete on disk (Downloader.Desktop).
Full Changelog: bezzad/Downloader@v5.9.7...v5.9.8
5.9.7
Highlights
Adds
RemoteFileInfo.ContentType: the server'sContent-Typeheader (ornullwhen the serversends none), exposed alongside file name/size/range-support from the same no-extra-request probe —
useful for callers that need to classify a file whose name carries no usable extension.
Full Changelog: bezzad/Downloader@v5.9.6...v5.9.7
5.9.6
Highlights
A download now always reports how it ended.
🐛 Fixes
DownloadFileCompleted.StartDownloadended in one of four branches, and the last one — an "unexpected" terminal state — only logged a warning and returned. For anything driven by the events (rather than only awaiting the task) that meant the download never ended: no error, no file, nothing to retry, and a UI left showing it as still in progress. That branch now always sends a completion signal.Pause()that lands after every byte has been received leaves the status Paused with nothing left to do — a finished download. It is now reported as Completed instead of falling into the unexpected-state branch and being discarded.IncompleteDownloadExceptionnaming the state and the byte counts, so the cause is visible instead of silent.🔧 Under the hood
CompletionSignalTest) cover all three terminal paths — completed, cancelled, and paused-at-the-finish-line. The last one fails against 5.9.5.Found while tracing a download manager whose row stayed "downloading" forever against a server that refused its requests (Downloader.Desktop #9).
What's Changed
Full Changelog: bezzad/Downloader@v5.9.5...v5.9.6
Commits viewable in compare view.
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)