Feature/enable resume download - #212
Conversation
…oad functionality
…l Size During Download
…ng files as automattically
…mproved assertions
…ated configurations
… for download package management
There was a problem hiding this comment.
Pull request overview
This PR adds an automatic “resume download” mechanism by persisting DownloadPackage metadata into the in-progress download file and updates docs/samples/tests/dev tooling accordingly.
Changes:
- Replaced
EnableResumeDownloadwithEnableAutoResumeDownloadand implemented embedding/reloading of resume metadata from the.downloadfile. - Added a binary serializer abstraction and implementation used for writing/reading embedded package metadata.
- Updated README, samples, tests, and VS Code tasks/launch configs to match the new resume behavior and naming.
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Samples/Downloader.Sample/Program.cs | Sample console improvements for redirected input and key handling. |
| src/Samples/Downloader.Sample/Program.Config.cs | Sample config updated to EnableAutoResumeDownload. |
| src/Downloader/SocketClient.cs | Updated extensions namespace import. |
| src/Downloader/Serializer/IBinarySerializer.cs | Introduces serializer abstraction for embedded metadata. |
| src/Downloader/Serializer/BsonSerializer.cs | Adds serializer implementation used for embedded metadata. |
| src/Downloader/Extensions/FileHelper.cs | Moves helper namespace and minor comment tweak. |
| src/Downloader/Extensions/ExceptionHelper.cs | Moves helper namespace and expands “momentum” error detection to inner exceptions. |
| src/Downloader/DownloadService.cs | Implements file-based auto-resume: reads embedded metadata and truncates it on completion. |
| src/Downloader/DownloadPackage.cs | Adds JsonIgnore to runtime/computed members to support serialization. |
| src/Downloader/DownloadConfiguration.cs | Renames option and expands documentation for auto-resume behavior. |
| src/Downloader/ConcurrentStream.cs | Adds ReadAsync(Memory<byte>), JSON ignores for runtime members, and minor access/spelling adjustments. |
| src/Downloader/ChunkDownloader.cs | Minor formatting + introduces TODO block in hot loop. |
| src/Downloader/Chunk.cs | Adds JsonIgnore to computed properties for serialization. |
| src/Downloader/AbstractDownloadService.cs | Adds periodic package serialization to the download file when auto-resume is enabled. |
| src/Downloader.Test/UnitTests/FileHelperTest.cs | Updates namespace usage. |
| src/Downloader.Test/UnitTests/DownloadBuilderTest.cs | Adjusts exception-policy tests to assert via completion event. |
| src/Downloader.Test/IntegrationTests/DownloadServiceTest.cs | Adds extensive auto-resume integration tests and updates file-exist policy behavior assertions. |
| src/Downloader.Test/IntegrationTests/DownloadIntegrationTest.cs | Updates namespace usage. |
| src/Downloader.Test/HelperTests/ExceptionHelperTest.cs | Updates namespace usage. |
| src/Downloader.Test/GlobalUsings.cs | Removes old extensions helpers global using. |
| src/.vscode/tasks.json | Adds build task for the sample project in VS Code (when opening src as workspace). |
| src/.vscode/launch.json | Adds VS Code debug launch configuration for the sample project. |
| README.md | Overhauls documentation to explain manual vs automatic resume and .download file behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 35 out of 35 changed files in this pull request and generated 17 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…d improve download stability
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 35 out of 35 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 35 out of 36 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This pull request introduces several improvements and clarifications to the downloader's documentation and codebase, focusing on download resumption, file handling, and developer experience. The most significant changes are the overhaul of the README to clarify manual and automatic resume mechanisms, updates to configuration options, and enhancements to test and build tooling.
Documentation and Configuration Improvements
DownloadPackageobject, while the automatic approach (EnableAutoResumeDownload) embeds metadata directly into the.downloadfile, enabling seamless resumption without manual intervention. The documentation now provides detailed explanations, code examples, and notes about server requirements. [1] [2] [3]EnableResumeDownloadwithEnableAutoResumeDownloadin both documentation and sample code. Clarified the behavior ofDownloadFileExtensionand improved comments for configuration properties.Developer Experience Enhancements
.vscode/launch.jsonand.vscode/tasks.jsonfiles to enable easy debugging and building of the sample project from within VS Code. [1] [2]Codebase and Test Improvements
Downloader.Extensionsnamespace instead ofDownloader.Extensions.Helpers. [1] [2] [3] [4] [5]ShouldThrowExceptionIfFileExistunit test to capture exceptions via theDownloadFileCompletedevent, ensuring accurate assertion and error handling. [1] [2]Internal API Changes
StartDownloadmethod, improving maintainability and consistency in file handling. Added a binary serializer property for package metadata. [1] [2] [3] [4] [5]These changes collectively improve usability, reliability, and clarity for both end users and developers working on or integrating the downloader library.