From 69294b17b87554211fc5b7e8eef89eca488cfd3d Mon Sep 17 00:00:00 2001 From: beyondkmp Date: Wed, 18 Jun 2025 14:20:36 +0800 Subject: [PATCH 01/10] feat(updater): add support for old block map file URL in blockmapFiles 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. --- packages/electron-updater/src/AppUpdater.ts | 8 +++++++- packages/electron-updater/src/util.ts | 11 +++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/packages/electron-updater/src/AppUpdater.ts b/packages/electron-updater/src/AppUpdater.ts index e239b4c9a16..046943e31c7 100644 --- a/packages/electron-updater/src/AppUpdater.ts +++ b/packages/electron-updater/src/AppUpdater.ts @@ -117,6 +117,12 @@ export abstract class AppUpdater extends (EventEmitter as new () => TypedEmitter */ forceDevUpdateConfig = false + /** + * The base URL of the old block map file. + * @default null + */ + oldBlockMapFileBaseUrl: string | null = null + /** * The current application version. */ @@ -790,7 +796,7 @@ export abstract class AppUpdater extends (EventEmitter as new () => TypedEmitter if (this._testOnlyOptions != null && !this._testOnlyOptions.isUseDifferentialDownload) { return true } - const blockmapFileUrls = blockmapFiles(fileInfo.url, this.app.version, downloadUpdateOptions.updateInfoAndProvider.info.version) + const blockmapFileUrls = blockmapFiles(fileInfo.url, this.app.version, downloadUpdateOptions.updateInfoAndProvider.info.version, this.oldBlockMapFileBaseUrl) this._logger.info(`Download block maps (old: "${blockmapFileUrls[0]}", new: ${blockmapFileUrls[1]})`) const downloadBlockMap = async (url: URL): Promise => { diff --git a/packages/electron-updater/src/util.ts b/packages/electron-updater/src/util.ts index 2216e3ac9fa..5580edff25d 100644 --- a/packages/electron-updater/src/util.ts +++ b/packages/electron-updater/src/util.ts @@ -30,8 +30,15 @@ export function getChannelFilename(channel: string): string { return `${channel}.yml` } -export function blockmapFiles(baseUrl: URL, oldVersion: string, newVersion: string): URL[] { +export function blockmapFiles(baseUrl: URL, oldVersion: string, newVersion: string, oldBlockMapFileBaseUrl: string | null=null): URL[] { const newBlockMapUrl = newUrlFromBase(`${baseUrl.pathname}.blockmap`, baseUrl) - const oldBlockMapUrl = newUrlFromBase(`${baseUrl.pathname.replace(new RegExp(escapeRegExp(newVersion), "g"), oldVersion)}.blockmap`, baseUrl) + + let oldBlockMapUrl: URL | null = null + if (oldBlockMapFileBaseUrl) { + oldBlockMapUrl = new URL(`${oldBlockMapFileBaseUrl}.blockmap` ) + } else { + oldBlockMapUrl = newUrlFromBase(`${baseUrl.pathname.replace(new RegExp(escapeRegExp(newVersion), "g"), oldVersion)}.blockmap`, baseUrl) + } + return [oldBlockMapUrl, newBlockMapUrl] } From 752a6b9382e6f2df0ef08ff759691094595b5394 Mon Sep 17 00:00:00 2001 From: beyondkmp Date: Wed, 18 Jun 2025 14:38:19 +0800 Subject: [PATCH 02/10] format code --- packages/dmg-builder/src/dmg.ts | 14 +++++++------- packages/electron-updater/src/util.ts | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/dmg-builder/src/dmg.ts b/packages/dmg-builder/src/dmg.ts index 30124bd0889..baee165fa15 100644 --- a/packages/dmg-builder/src/dmg.ts +++ b/packages/dmg-builder/src/dmg.ts @@ -206,13 +206,13 @@ async function createStageDmg(tempDmg: string, appPath: string, volumeName: stri imageArgs.push("-fs", "APFS") imageArgs.push(tempDmg) await hdiUtil(imageArgs).catch(async e => { - if (hdiutilTransientExitCodes.has(e.code)) { - // Delay then create, then retry with verbose output - await new Promise(resolve => setTimeout(resolve, 3000)) - return hdiUtil(addLogLevel(createArgs, true)) - } - throw e - }) + if (hdiutilTransientExitCodes.has(e.code)) { + // Delay then create, then retry with verbose output + await new Promise(resolve => setTimeout(resolve, 3000)) + return hdiUtil(addLogLevel(createArgs, true)) + } + throw e + }) return tempDmg } diff --git a/packages/electron-updater/src/util.ts b/packages/electron-updater/src/util.ts index 5580edff25d..571cb59723d 100644 --- a/packages/electron-updater/src/util.ts +++ b/packages/electron-updater/src/util.ts @@ -30,15 +30,15 @@ export function getChannelFilename(channel: string): string { return `${channel}.yml` } -export function blockmapFiles(baseUrl: URL, oldVersion: string, newVersion: string, oldBlockMapFileBaseUrl: string | null=null): URL[] { +export function blockmapFiles(baseUrl: URL, oldVersion: string, newVersion: string, oldBlockMapFileBaseUrl: string | null = null): URL[] { const newBlockMapUrl = newUrlFromBase(`${baseUrl.pathname}.blockmap`, baseUrl) let oldBlockMapUrl: URL | null = null if (oldBlockMapFileBaseUrl) { - oldBlockMapUrl = new URL(`${oldBlockMapFileBaseUrl}.blockmap` ) + oldBlockMapUrl = new URL(`${oldBlockMapFileBaseUrl}.blockmap`) } else { oldBlockMapUrl = newUrlFromBase(`${baseUrl.pathname.replace(new RegExp(escapeRegExp(newVersion), "g"), oldVersion)}.blockmap`, baseUrl) } - + return [oldBlockMapUrl, newBlockMapUrl] } From 6d54013dd8c2ace1ea7560939638aa503e74a6de Mon Sep 17 00:00:00 2001 From: beyondkmp Date: Wed, 18 Jun 2025 19:50:21 +0800 Subject: [PATCH 03/10] refactor(updater): encapsulate oldBlockMapFileBaseUrl with getter and 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. --- packages/electron-updater/src/AppUpdater.ts | 12 ++++++++++-- .../multipleRangeDownloader.ts | 2 +- packages/electron-updater/src/util.ts | 8 +------- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/packages/electron-updater/src/AppUpdater.ts b/packages/electron-updater/src/AppUpdater.ts index 046943e31c7..2d1d46e10b9 100644 --- a/packages/electron-updater/src/AppUpdater.ts +++ b/packages/electron-updater/src/AppUpdater.ts @@ -121,7 +121,7 @@ export abstract class AppUpdater extends (EventEmitter as new () => TypedEmitter * The base URL of the old block map file. * @default null */ - oldBlockMapFileBaseUrl: string | null = null + private _oldBlockMapFileBaseUrl: string | null = null /** * The current application version. @@ -139,6 +139,14 @@ export abstract class AppUpdater extends (EventEmitter as new () => TypedEmitter return this._channel } + get oldBlockMapFileBaseUrl(): string | null { + return this._oldBlockMapFileBaseUrl + } + + set oldBlockMapFileBaseUrl(value: string | null) { + this._oldBlockMapFileBaseUrl = value + } + /** * Set the update channel. Overrides `channel` in the update configuration. * @@ -796,7 +804,7 @@ export abstract class AppUpdater extends (EventEmitter as new () => TypedEmitter if (this._testOnlyOptions != null && !this._testOnlyOptions.isUseDifferentialDownload) { return true } - const blockmapFileUrls = blockmapFiles(fileInfo.url, this.app.version, downloadUpdateOptions.updateInfoAndProvider.info.version, this.oldBlockMapFileBaseUrl) + const blockmapFileUrls = blockmapFiles(fileInfo.url, this.app.version, downloadUpdateOptions.updateInfoAndProvider.info.version, this._oldBlockMapFileBaseUrl) this._logger.info(`Download block maps (old: "${blockmapFileUrls[0]}", new: ${blockmapFileUrls[1]})`) const downloadBlockMap = async (url: URL): Promise => { diff --git a/packages/electron-updater/src/differentialDownloader/multipleRangeDownloader.ts b/packages/electron-updater/src/differentialDownloader/multipleRangeDownloader.ts index 7b29a2fc1a9..b7b36f074bb 100644 --- a/packages/electron-updater/src/differentialDownloader/multipleRangeDownloader.ts +++ b/packages/electron-updater/src/differentialDownloader/multipleRangeDownloader.ts @@ -46,7 +46,7 @@ function doExecuteTasks(differentialDownloader: DifferentialDownloader, options: for (let i = options.start; i < options.end; i++) { const task = options.tasks[i] if (task.kind === OperationKind.DOWNLOAD) { - ranges += `${task.start}-${task.end - 1}, ` + ranges += `${task.start}-${task.end - 1},` partIndexToTaskIndex.set(partCount, i) partCount++ partIndexToLength.push(task.end - task.start) diff --git a/packages/electron-updater/src/util.ts b/packages/electron-updater/src/util.ts index 571cb59723d..3c4da9505a2 100644 --- a/packages/electron-updater/src/util.ts +++ b/packages/electron-updater/src/util.ts @@ -32,13 +32,7 @@ export function getChannelFilename(channel: string): string { export function blockmapFiles(baseUrl: URL, oldVersion: string, newVersion: string, oldBlockMapFileBaseUrl: string | null = null): URL[] { const newBlockMapUrl = newUrlFromBase(`${baseUrl.pathname}.blockmap`, baseUrl) - - let oldBlockMapUrl: URL | null = null - if (oldBlockMapFileBaseUrl) { - oldBlockMapUrl = new URL(`${oldBlockMapFileBaseUrl}.blockmap`) - } else { - oldBlockMapUrl = newUrlFromBase(`${baseUrl.pathname.replace(new RegExp(escapeRegExp(newVersion), "g"), oldVersion)}.blockmap`, baseUrl) - } + const oldBlockMapUrl = newUrlFromBase(`${baseUrl.pathname.replace(new RegExp(escapeRegExp(newVersion), "g"), oldVersion)}.blockmap`, oldBlockMapFileBaseUrl ? new URL(oldBlockMapFileBaseUrl) : baseUrl) return [oldBlockMapUrl, newBlockMapUrl] } From c4add6bade9b07221f4396ca2026e89113ac7849 Mon Sep 17 00:00:00 2001 From: beyondkmp Date: Thu, 19 Jun 2025 09:14:01 +0800 Subject: [PATCH 04/10] cache the new old blockmap --- packages/electron-updater/src/AppUpdater.ts | 37 ++++++++++++++++++--- packages/electron-updater/src/util.ts | 5 ++- 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/packages/electron-updater/src/AppUpdater.ts b/packages/electron-updater/src/AppUpdater.ts index 2d1d46e10b9..002c74eae2f 100644 --- a/packages/electron-updater/src/AppUpdater.ts +++ b/packages/electron-updater/src/AppUpdater.ts @@ -15,7 +15,7 @@ import { import { randomBytes } from "crypto" import { release } from "os" import { EventEmitter } from "events" -import { mkdir, outputFile, readFile, rename, unlink } from "fs-extra" +import { mkdir, outputFile, readFile, rename, unlink, copyFile, pathExists } from "fs-extra" import { OutgoingHttpHeaders } from "http" import { load } from "js-yaml" import { Lazy } from "lazy-val" @@ -31,7 +31,7 @@ import { Provider, ProviderPlatform } from "./providers/Provider" import type { TypedEmitter } from "tiny-typed-emitter" import Session = Electron.Session import type { AuthInfo } from "electron" -import { gunzipSync } from "zlib" +import { gunzipSync, gzipSync } from "zlib" import { blockmapFiles } from "./util" import { DifferentialDownloaderOptions } from "./differentialDownloader/DifferentialDownloader" import { GenericDifferentialDownloader } from "./differentialDownloader/GenericDifferentialDownloader" @@ -750,6 +750,10 @@ export abstract class AppUpdater extends (EventEmitter as new () => TypedEmitter ...updateInfo, downloadedFile: updateFile, }) + const currentBlockMapFile = path.join(cacheDir, "current.blockmap") + if (await pathExists(currentBlockMapFile)) { + await copyFile(currentBlockMapFile, path.join(downloadedUpdateHelper.cacheDir, "current.blockmap")) + } return packageFile == null ? [updateFile] : [updateFile, packageFile] } @@ -838,8 +842,33 @@ export abstract class AppUpdater extends (EventEmitter as new () => TypedEmitter downloadOptions.onProgress = it => this.emit(DOWNLOAD_PROGRESS, it) } - const blockMapDataList = await Promise.all(blockmapFileUrls.map(u => downloadBlockMap(u))) - await new GenericDifferentialDownloader(fileInfo.info, this.httpExecutor, downloadOptions).download(blockMapDataList[0], blockMapDataList[1]) + const saveBlockMapToCacheDir = async (blockMapData: BlockMap, cacheDir: string) => { + const blockMapFile = path.join(cacheDir, "current.blockmap") + await outputFile(blockMapFile, gzipSync(JSON.stringify(blockMapData))) + } + + const getBlockMapFromCacheDir = async (cacheDir: string) => { + const blockMapFile = path.join(cacheDir, "current.blockmap") + try { + if (await pathExists(blockMapFile)) { + return JSON.parse(gunzipSync(await readFile(blockMapFile)).toString()) + } + } catch (e: any) { + this._logger.warn(`Cannot parse blockmap "${blockMapFile}", error: ${e}`) + } + return null + } + + const newBlockMapData = await downloadBlockMap(blockmapFileUrls[0]) + await saveBlockMapToCacheDir(newBlockMapData, this.downloadedUpdateHelper!.cacheDirForPendingUpdate) + + // get old blockmap from cache dir first, if not found, download it + let oldBlockMapData = await getBlockMapFromCacheDir(this.downloadedUpdateHelper!.cacheDir) + if (oldBlockMapData == null) { + oldBlockMapData = await downloadBlockMap(blockmapFileUrls[1]) + } + + await new GenericDifferentialDownloader(fileInfo.info, this.httpExecutor, downloadOptions).download(newBlockMapData, oldBlockMapData) return false } catch (e: any) { this._logger.error(`Cannot download differentially, fallback to full download: ${e.stack || e}`) diff --git a/packages/electron-updater/src/util.ts b/packages/electron-updater/src/util.ts index 3c4da9505a2..e9f0d652ff1 100644 --- a/packages/electron-updater/src/util.ts +++ b/packages/electron-updater/src/util.ts @@ -32,7 +32,10 @@ export function getChannelFilename(channel: string): string { export function blockmapFiles(baseUrl: URL, oldVersion: string, newVersion: string, oldBlockMapFileBaseUrl: string | null = null): URL[] { const newBlockMapUrl = newUrlFromBase(`${baseUrl.pathname}.blockmap`, baseUrl) - const oldBlockMapUrl = newUrlFromBase(`${baseUrl.pathname.replace(new RegExp(escapeRegExp(newVersion), "g"), oldVersion)}.blockmap`, oldBlockMapFileBaseUrl ? new URL(oldBlockMapFileBaseUrl) : baseUrl) + const oldBlockMapUrl = newUrlFromBase( + `${baseUrl.pathname.replace(new RegExp(escapeRegExp(newVersion), "g"), oldVersion)}.blockmap`, + oldBlockMapFileBaseUrl ? new URL(oldBlockMapFileBaseUrl) : baseUrl + ) return [oldBlockMapUrl, newBlockMapUrl] } From fa3b24f27c203dcbd09c96ae6d0f9d17eddd2d75 Mon Sep 17 00:00:00 2001 From: beyondkmp Date: Thu, 19 Jun 2025 09:20:56 +0800 Subject: [PATCH 05/10] fix order --- packages/electron-updater/src/AppUpdater.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/electron-updater/src/AppUpdater.ts b/packages/electron-updater/src/AppUpdater.ts index 002c74eae2f..0181cfdfd4f 100644 --- a/packages/electron-updater/src/AppUpdater.ts +++ b/packages/electron-updater/src/AppUpdater.ts @@ -859,16 +859,16 @@ export abstract class AppUpdater extends (EventEmitter as new () => TypedEmitter return null } - const newBlockMapData = await downloadBlockMap(blockmapFileUrls[0]) + const newBlockMapData = await downloadBlockMap(blockmapFileUrls[1]) await saveBlockMapToCacheDir(newBlockMapData, this.downloadedUpdateHelper!.cacheDirForPendingUpdate) // get old blockmap from cache dir first, if not found, download it let oldBlockMapData = await getBlockMapFromCacheDir(this.downloadedUpdateHelper!.cacheDir) if (oldBlockMapData == null) { - oldBlockMapData = await downloadBlockMap(blockmapFileUrls[1]) + oldBlockMapData = await downloadBlockMap(blockmapFileUrls[0]) } - await new GenericDifferentialDownloader(fileInfo.info, this.httpExecutor, downloadOptions).download(newBlockMapData, oldBlockMapData) + await new GenericDifferentialDownloader(fileInfo.info, this.httpExecutor, downloadOptions).download(oldBlockMapData, newBlockMapData) return false } catch (e: any) { this._logger.error(`Cannot download differentially, fallback to full download: ${e.stack || e}`) From 27f9c615eed31c4d0f982a1f2071975b7f164002 Mon Sep 17 00:00:00 2001 From: beyondkmp Date: Thu, 19 Jun 2025 09:28:04 +0800 Subject: [PATCH 06/10] format code --- test/src/binDownloadTest.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/src/binDownloadTest.ts b/test/src/binDownloadTest.ts index 327017d18e3..3ed5706c5c7 100644 --- a/test/src/binDownloadTest.ts +++ b/test/src/binDownloadTest.ts @@ -17,7 +17,7 @@ test("download binary from Mirror with custom dir", async ({ expect }) => { "linux-tools-mac-10.12.3.7z", "SQ8fqIRVXuQVWnVgaMTDWyf2TLAJjJYw3tRSqQJECmgF6qdM7Kogfa6KD49RbGzzMYIFca9Uw3MdsxzOPRWcYw==" ) - delete process.env.ELECTRON_BUILDER_BINARIES_MIRROR + delete process.env.ELECTRON_BUILDER_BINARIES_MIRROR delete process.env.ELECTRON_BUILDER_BINARIES_CUSTOM_DIR expect(bin).toBeTruthy() }) @@ -29,7 +29,7 @@ test("download binary from Mirror", async ({ expect }) => { "linux-tools-mac-10.12.3.7z", "SQ8fqIRVXuQVWnVgaMTDWyf2TLAJjJYw3tRSqQJECmgF6qdM7Kogfa6KD49RbGzzMYIFca9Uw3MdsxzOPRWcYw==" ) - delete process.env.ELECTRON_BUILDER_BINARIES_MIRROR + delete process.env.ELECTRON_BUILDER_BINARIES_MIRROR expect(bin).toBeTruthy() }) @@ -40,6 +40,6 @@ test("download binary from Mirror with Url override", async ({ expect }) => { "linux-tools-mac-10.12.3.7z", "SQ8fqIRVXuQVWnVgaMTDWyf2TLAJjJYw3tRSqQJECmgF6qdM7Kogfa6KD49RbGzzMYIFca9Uw3MdsxzOPRWcYw==" ) - delete process.env.ELECTRON_BUILDER_BINARIES_DOWNLOAD_OVERRIDE_URL + delete process.env.ELECTRON_BUILDER_BINARIES_DOWNLOAD_OVERRIDE_URL expect(bin).toBeTruthy() }) From 30071a6b075e8e4f60fddf57576bba25edbe9d44 Mon Sep 17 00:00:00 2001 From: beyondkmp Date: Fri, 20 Jun 2025 19:35:50 +0800 Subject: [PATCH 07/10] docs(updater): enhance documentation for oldBlockMapFileBaseUrl property - 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. --- packages/electron-updater/src/AppUpdater.ts | 6 ++++++ .../src/differentialDownloader/multipleRangeDownloader.ts | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/electron-updater/src/AppUpdater.ts b/packages/electron-updater/src/AppUpdater.ts index 0181cfdfd4f..e5317b04e9d 100644 --- a/packages/electron-updater/src/AppUpdater.ts +++ b/packages/electron-updater/src/AppUpdater.ts @@ -119,6 +119,12 @@ export abstract class AppUpdater extends (EventEmitter as new () => TypedEmitter /** * The base URL of the old block map file. + * + * When null, the updater will use the base URL of the update file to download the update. + * When set, the updater will use this string as the base URL of the old block map file. + * Some servers like github cannot download the old block map file from latest release, + * so you need to compute the old block map file base URL manually. + * * @default null */ private _oldBlockMapFileBaseUrl: string | null = null diff --git a/packages/electron-updater/src/differentialDownloader/multipleRangeDownloader.ts b/packages/electron-updater/src/differentialDownloader/multipleRangeDownloader.ts index b7b36f074bb..7b29a2fc1a9 100644 --- a/packages/electron-updater/src/differentialDownloader/multipleRangeDownloader.ts +++ b/packages/electron-updater/src/differentialDownloader/multipleRangeDownloader.ts @@ -46,7 +46,7 @@ function doExecuteTasks(differentialDownloader: DifferentialDownloader, options: for (let i = options.start; i < options.end; i++) { const task = options.tasks[i] if (task.kind === OperationKind.DOWNLOAD) { - ranges += `${task.start}-${task.end - 1},` + ranges += `${task.start}-${task.end - 1}, ` partIndexToTaskIndex.set(partCount, i) partCount++ partIndexToLength.push(task.end - task.start) From a117225306db6454a992e97e4e96355d62aee07f Mon Sep 17 00:00:00 2001 From: beyondkmp Date: Fri, 20 Jun 2025 19:37:57 +0800 Subject: [PATCH 08/10] add changeset --- .changeset/orange-experts-do.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/orange-experts-do.md diff --git a/.changeset/orange-experts-do.md b/.changeset/orange-experts-do.md new file mode 100644 index 00000000000..d7559489ab2 --- /dev/null +++ b/.changeset/orange-experts-do.md @@ -0,0 +1,5 @@ +--- +"electron-updater": patch +--- + +feat(updater): Cache the new blockmap file and allow customization of the old blockmap file base URL From 35eb8c933a306fadd25f216618039b196734249b Mon Sep 17 00:00:00 2001 From: beyondkmp Date: Sat, 21 Jun 2025 08:10:50 +0800 Subject: [PATCH 09/10] refactor(updater): replace oldBlockMapFileBaseUrl with previousBlockmapBaseUrlOverride - Renamed the property `oldBlockMapFileBaseUrl` to `previousBlockmapBaseUrlOverride` for clarity. - Removed the getter and setter methods associated with the old property to simplify the code structure. --- packages/electron-updater/src/AppUpdater.ts | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/packages/electron-updater/src/AppUpdater.ts b/packages/electron-updater/src/AppUpdater.ts index e5317b04e9d..893d4dd1489 100644 --- a/packages/electron-updater/src/AppUpdater.ts +++ b/packages/electron-updater/src/AppUpdater.ts @@ -127,7 +127,7 @@ export abstract class AppUpdater extends (EventEmitter as new () => TypedEmitter * * @default null */ - private _oldBlockMapFileBaseUrl: string | null = null + public previousBlockmapBaseUrlOverride: string | null = null /** * The current application version. @@ -145,14 +145,6 @@ export abstract class AppUpdater extends (EventEmitter as new () => TypedEmitter return this._channel } - get oldBlockMapFileBaseUrl(): string | null { - return this._oldBlockMapFileBaseUrl - } - - set oldBlockMapFileBaseUrl(value: string | null) { - this._oldBlockMapFileBaseUrl = value - } - /** * Set the update channel. Overrides `channel` in the update configuration. * From 9d0b8a3b055e024065eddfee60bfc92a4a553035 Mon Sep 17 00:00:00 2001 From: beyondkmp Date: Sat, 21 Jun 2025 08:21:27 +0800 Subject: [PATCH 10/10] fix(updater): update blockmap file URL reference to use previousBlockmapBaseUrlOverride - Changed the reference in the blockmapFiles function to use the new property `previousBlockmapBaseUrlOverride` instead of the deprecated `oldBlockMapFileBaseUrl`. --- packages/electron-updater/src/AppUpdater.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/electron-updater/src/AppUpdater.ts b/packages/electron-updater/src/AppUpdater.ts index 893d4dd1489..53d9053ed71 100644 --- a/packages/electron-updater/src/AppUpdater.ts +++ b/packages/electron-updater/src/AppUpdater.ts @@ -806,7 +806,7 @@ export abstract class AppUpdater extends (EventEmitter as new () => TypedEmitter if (this._testOnlyOptions != null && !this._testOnlyOptions.isUseDifferentialDownload) { return true } - const blockmapFileUrls = blockmapFiles(fileInfo.url, this.app.version, downloadUpdateOptions.updateInfoAndProvider.info.version, this._oldBlockMapFileBaseUrl) + const blockmapFileUrls = blockmapFiles(fileInfo.url, this.app.version, downloadUpdateOptions.updateInfoAndProvider.info.version, this.previousBlockmapBaseUrlOverride) this._logger.info(`Download block maps (old: "${blockmapFileUrls[0]}", new: ${blockmapFileUrls[1]})`) const downloadBlockMap = async (url: URL): Promise => {