Skip to content

feat: Provide progress updates for multiple range differential downloads#9448

Merged
mmaietta merged 3 commits intoelectron-userland:masterfrom
eliotschu:feat--multiple-range-progress-updates
Dec 22, 2025
Merged

feat: Provide progress updates for multiple range differential downloads#9448
mmaietta merged 3 commits intoelectron-userland:masterfrom
eliotschu:feat--multiple-range-progress-updates

Conversation

@eliotschu
Copy link
Copy Markdown
Contributor

Summary of Changes

  • Pass total number of expected download bytes and onProgress event emitter to multiple range differential download data splitter
  • Update transferred and delta when processing downloaded part data
  • After each chunk of data is handled in data splitter, check timer and emit progress message if 1s has passed, or download is complete
  • Remove TODO note about this feature not being implemented

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Dec 15, 2025

🦋 Changeset detected

Latest commit: 0b6d9e2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
electron-updater Minor

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.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator

@mmaietta mmaietta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome. Thanks for submitting this PR

Copy link
Copy Markdown
Collaborator

@mmaietta mmaietta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@eliotschu
Copy link
Copy Markdown
Contributor Author

I have added comments for the new class properties and added a check that the divisors copilot review mentioned are truthy before attempting division.

@eliotschu eliotschu requested a review from mmaietta December 21, 2025 23:35
@eliotschu
Copy link
Copy Markdown
Contributor Author

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!

@mmaietta mmaietta merged commit 3533a3e into electron-userland:master Dec 22, 2025
55 of 56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants