feat: Provide progress updates for multiple range differential downloads#9448
feat: Provide progress updates for multiple range differential downloads#9448mmaietta merged 3 commits intoelectron-userland:masterfrom eliotschu:feat--multiple-range-progress-updates
Conversation
🦋 Changeset detectedLatest commit: 0b6d9e2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Add emission of download-progress events when multiple range differential downloads are performed. Previously, no progress update events were emitted if this download method was used.
There was a problem hiding this comment.
Pull request overview
This PR implements progress reporting for multiple range differential downloads in the electron-updater. Previously, progress events were only supported for single-range downloads (as indicated by the removed TODO comment). The implementation adds byte tracking and timed progress emission to the DataSplitter class, which handles multipart HTTP responses.
Key changes:
- Track total expected download bytes across all download ranges
- Emit progress events every 1 second during download and upon completion
- Update transferred and delta byte counters as data chunks are processed
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| multipleRangeDownloader.ts | Calculate total download bytes and pass progress callback to DataSplitter |
| DifferentialDownloader.ts | Remove TODO comment about missing multiple range progress support |
| DataSplitter.ts | Add progress tracking state, emit progress events during data processing |
| .changeset/three-pens-sit.md | Document the feature addition for version tracking |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mmaietta
left a comment
There was a problem hiding this comment.
This is awesome. Thanks for submitting this PR
mmaietta
left a comment
There was a problem hiding this comment.
Please address copilot comments
Add checks for divisors (grand total bytes and elapsed time) to be truthy to prevent division by 0 errors. Add comments specifying function of new class properties.
|
I have added comments for the new class properties and added a check that the divisors copilot review mentioned are truthy before attempting division. |
|
I see that one of the tests failed. It looks like a similar failure to a couple of the linux e2e tests that failed on the last commit to master. Let me know if you think there are actually potential issues I should look into with this branch! |
Summary of Changes