Skip to content

feat: Support caching the blockmap file for the new version #9029

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

beyondkmp
Copy link
Collaborator

Currently, by default, both the new and old blockmap files are downloaded, resulting in double the CDN requests and traffic. Since the blockmap file is very small, we can keep a copy of the current version locally, so only the new version’s blockmap file needs to be downloaded, saving half of the CDN requests and traffic.

Copy link

changeset-bot bot commented Apr 13, 2025

🦋 Changeset detected

Latest commit: ba1e1d7

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

@mmaietta
Copy link
Collaborator

we can keep a copy of the current version locally, so only the new version’s blockmap file needs to be downloaded

I think this is missing some edge cases, one of which is security-related I think?

  • If the local "old"/current blockmap is manipulated before blockmap check, could that lead to a security vulnerability?
  • Wondering if there's a previous reason as to why we want a "fresh" blockmap downloaded when checking for updates

const dataBuffer = Buffer.allocUnsafe(sizeBuffer.readUInt32BE(0))
await read(fd, dataBuffer, 0, dataBuffer.length, fileSize - sizeBuffer.length - dataBuffer.length)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants