Skip to content

feat(updater): Cache the new blockmap file and allow customization of the old blockmap file base URL. #9172

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Jun 22, 2025

Conversation

beyondkmp
Copy link
Collaborator

@beyondkmp beyondkmp commented Jun 18, 2025

Currently, downloading updates from GitHub's Latest Release does not support delta updates. This is mainly due to the inability to download the old map file. Now, by adding a configuration that allows users to customize the old map file URL, users can define the old map file URL themselves. This makes it possible to achieve delta updates without modifying the server side.

Cache the new blockmap file, and during the next update, prioritize reading it from the local cache. This reduces requests for the blockmap and allows delta updates even if the old version’s blockmap file is no longer available on the server.

Fix #8811

…s function

- Introduced `oldBlockMapFileBaseUrl` property in AppUpdater class to specify the base URL for the old block map file.
- Updated `blockmapFiles` function to accept an optional `oldBlockMapFileBaseUrl` parameter, allowing for more flexible block map URL generation.
Copy link

changeset-bot bot commented Jun 18, 2025

🦋 Changeset detected

Latest commit: 9d0b8a3

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 Patch

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

… setter

- Changed `oldBlockMapFileBaseUrl` to a private property and added public getter and setter methods for better encapsulation.
- Updated references in the `blockmapFiles` function to use the new private property.
- Cleaned up the logic for generating the old block map URL in the `blockmapFiles` function.
@beyondkmp beyondkmp changed the title feat(updater): add support for old block map file URL in blockmapFiles function feat(updater): Cache the new blockmap file and allow customization of the old blockmap file base URL. Jun 19, 2025
@mmaietta
Copy link
Collaborator

This looks good!

- Added detailed comments explaining the behavior of the oldBlockMapFileBaseUrl property in the AppUpdater class.
- Clarified the conditions under which the updater uses the base URL for the old block map file.
@beyondkmp beyondkmp requested a review from mmaietta June 20, 2025 11:39
@mmaietta
Copy link
Collaborator

mmaietta commented Jun 20, 2025

Left a comment, but otherwise this LGTM! Nice work!

…apBaseUrlOverride

- Renamed the property `oldBlockMapFileBaseUrl` to `previousBlockmapBaseUrlOverride` for clarity.
- Removed the getter and setter methods associated with the old property to simplify the code structure.
…mapBaseUrlOverride

- Changed the reference in the blockmapFiles function to use the new property `previousBlockmapBaseUrlOverride` instead of the deprecated `oldBlockMapFileBaseUrl`.
@beyondkmp beyondkmp merged commit cb651dd into electron-userland:master Jun 22, 2025
35 of 36 checks passed
@beyondkmp beyondkmp deleted the oldblockmapfilecustom branch June 22, 2025 01:20
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.

Enable differential download with only new blockmap
2 participants