Brave-browser: Less expensive upgrade process on macOS (delta installer)

Created on 19 Oct 2019  路  7Comments  路  Source: brave/brave-browser

Description

About every 7 days, my (macOS 10.14, desktop) Brave upgrades to a (usually minor) new version. From my experience so far, it's about a 100MB download. In my country (馃嚚馃嚭) that's ends up costing around USD $7 monthly for cellular data. Considering that the average salary here is $30-$40, that's way too much (and no, there's no free wi-fi..)

Steps to Reproduce

  1. Use Brave
  2. Periodically it will consume about 100MB downloading updates
  3. 3.

Actual result:

Using the theoretically free Brave browser costs about USD $7 every month

Expected result:

  1. The upgrade process should be a separate application that can be easily blocked, if needed.

  2. The settings should allow control of the update process (eg, only update for major versions, notify when a high-priority security upgrade is needed, upgrade only when not metered, etc.) Currently the only thing we can do is restart the upgrade from chrome://settings/help

  3. The update process should be more efficient (smaller downloads by using a vX-to-vCURRENT patch like Google does, the download is fully resumable, and only corrupt fragments are redownloaded-as-needed like torrents can do)

Reproduces how often:

Usually every week

Brave version (brave://version info)

Any current or previous version

Other Additional Information:

Miscellaneous Information:

OmacOS QNo prioritP4 release-noteinclude setuinstaller

Most helpful comment

Sparkle's BinaryDelta treats directory symlink as a file instead of directory.
and it generates files delta only for same file path.
Due to this, different versioned two browser apps will have huge delta file.
App bundle have different direcoty name like below and Current symlink to it.

App bundle 1.
.../Brave Browser Framework.framework/Versions/86.1.18.3
.../Brave Browser Framework.framework/Versions/Current -> 86.1.18.3

App bundle 2.
.../Brave Browser Framework.framework/Versions/86.1.18.5
.../Brave Browser Framework.framework/Versions/Current -> 86.1.18.5

Currently, I'm trying to generate only delta for files in ...Brave Browser Framework.framework/Versions/Current/ because Current occupies of most of app's data size.

All 7 comments

cc: @bkero. We should probably define this in a different issue for patch upgrades.

Please, if enhancing the update infrastructure is not a priority, at least provide a way to pause updates or ask for user's consent before downloading. It's costing more than $10/monthly. Too much for a product that's supposed to be free, not to mention there are much better ways to spend that amount (than supporting a state monopoly)

@jromero2k it definitely is a priority - @simonhong is working on this now 馃槃 We're tackling Windows first with https://github.com/brave/brave-browser/issues/9565. I believe he was able to get a delta installer created that was only 3MB in size

@simonhong is Sparkle (macOS) able to take advantage of these changes too? Or just Omaha?

Currently my work is only for windows installer.
Need to investigate it's possible to enable delta installer on macOS.

Sparkle's BinaryDelta treats directory symlink as a file instead of directory.
and it generates files delta only for same file path.
Due to this, different versioned two browser apps will have huge delta file.
App bundle have different direcoty name like below and Current symlink to it.

App bundle 1.
.../Brave Browser Framework.framework/Versions/86.1.18.3
.../Brave Browser Framework.framework/Versions/Current -> 86.1.18.3

App bundle 2.
.../Brave Browser Framework.framework/Versions/86.1.18.5
.../Brave Browser Framework.framework/Versions/Current -> 86.1.18.5

Currently, I'm trying to generate only delta for files in ...Brave Browser Framework.framework/Versions/Current/ because Current occupies of most of app's data size.

Verified Below process works

  • Delta creation step (by running BinaryDelta create ...

    1. Generate delta from all files in Brave Browser.app bundle except Brave Browser.app//Contents/Frameworks/Brave Browser Framework.framework/Versions/.
    2. Generate delta from all files in Brave Browser.app//Contents/Frameworks/Brave Browser Framework.framework/Versions/Current
    3. Store old and new version string as a props of delta file
  • Delta applying step (by running BinaryDelta apply ...

    • Applying delta files generated from above step.
    • Then all files are updated and only Brave Browser Framework.framework/Versions/86.1.18.3 directory name is not changed yet
    • Fetch old & new version string from delta file's prop and rename old version dir to new version dir name and create Current link to it

With these two steps, newly patched App from 86.1.18.3 with delta files has same hash with 86.1.18.4

Sparkle implementation is done - https://github.com/brave/Sparkle/pull/11/commits/0a0cad0cc27dbe51dcb4c2e1a48d5675c51ff945

All related work has been merged and production has been updated.

Nightly users on 1.18.41 and up will be served delta updates.

Was this page helpful?
0 / 5 - 0 ratings