A full-featured download manager.
feat(release): enable paired desktop handoff by default in 2.4.5 (#2539)
Dr_rOot6099f17c585e
diff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlindex 1b246771..21b6a53e 100644--- a/.github/workflows/release.yml+++ b/.github/workflows/release.yml@@ -941,7 +941,7 @@ jobs:EXPECTED_COMMIT: ${{ github.sha }}EXPECTED_PLATFORM: ${{ matrix.platform }}# Updated only after reviewing the verifier source itself.- VERIFIER_SHA256: 1bb955c5499fe9160f7ee26ddf91b20dfe32abfa6d1d6e258b27a045e18df759+ VERIFIER_SHA256: 7fbe001750d6edf30e883521f7c7b0ec252d429c33157b961b46abcbff8a9c66run: |const crypto = require('node:crypto')const fs = require('node:fs')diff --git a/README.md b/README.mdindex 7c004b30..9d51f888 100644--- a/README.md+++ b/README.md@@ -19,12 +19,11 @@ The same core powers two ways to run Motrix:- **Desktop app:** Runs on macOS, Windows, and Linux- **Headless server:** Runs without a desktop environment, either directly on Node.js or in Docker, and includes a web UI for NAS devices and home servers-## Motrix 2.4.4+## Motrix 2.4.5-Large multi-file torrents now use compact file selections and the updated aria2 engine.-Motrix now uses MDXP 0.10.0 and includes the SQLite ledger for paired download handoffs. Browser Extension 0.1.24 continues to use the existing submission flow.-Download [v2.4.4 from GitHub Releases](https://github.com/agalwood/Motrix/releases/tag/v2.4.4)-and read the [full release notes](./docs/release-notes/2.4.4.md).+Desktop supports local download handoffs with Browser Extension 0.1.25 by default. After a lost acknowledgement, the extension can reconnect and look up the original task.+Download [v2.4.5 from GitHub Releases](https://github.com/agalwood/Motrix/releases/tag/v2.4.5)+and read the [full release notes](./docs/release-notes/2.4.5.md).Back up your existing Motrix profile and downloads before upgrading. The bundledengine upgrades its SQLite database to schema 6 and keeps a pre-upgrade backup;@@ -185,7 +184,7 @@ included `compose.yaml` keeps Server state separate from downloaded resources:```bashmkdir -p motrix-data downloadssudo chown 1000:1000 motrix-data downloads-export MOTRIX_IMAGE='docker.io/motrixapp/motrix-server:2.4.4'+export MOTRIX_IMAGE='docker.io/motrixapp/motrix-server:2.4.5'export MOTRIX_PUBLIC_URL='http://nas.example.lan:8080'docker compose pull serverdocker compose up -d --waitdiff --git a/README.zh-CN.md b/README.zh-CN.mdindex 301c3514..b33c51d0 100644--- a/README.zh-CN.md+++ b/README.zh-CN.md@@ -19,12 +19,11 @@ Motrix 是一款界面简洁、功能丰富的桌面下载管理器,可处理- **桌面应用**:可在 macOS、Windows 和 Linux 上运行;- **Headless server**:无需桌面环境,可直接使用 Node.js 运行或通过 Docker 部署,并提供 Web 界面,适合安装在 NAS 和家庭服务器上。-## Motrix 2.4.4+## Motrix 2.4.5-修复了添加多文件大种子时下载引擎卡住的问题。-Motrix 升级到 MDXP 0.10.0,并集成用于记录配对下载交接的 SQLite 账本。浏览器扩展 0.1.24 继续通过原有接口提交下载。-从 GitHub Releases 下载 [v2.4.4](https://github.com/agalwood/Motrix/releases/tag/v2.4.4),-并阅读[完整发布说明](./docs/release-notes/2.4.4.zh-CN.md)。+桌面端默认支持扩展 0.1.25 的本机下载交接。提交后意外断线时,扩展可重连查询原任务。+从 GitHub Releases 下载 [v2.4.5](https://github.com/agalwood/Motrix/releases/tag/v2.4.5),+并阅读[完整发布说明](./docs/release-notes/2.4.5.zh-CN.md)。升级前请备份现有 Motrix 配置和下载文件。捆绑引擎会将 SQLite 数据库升级至schema 6,并保留升级前备份;旧引擎无法打开 schema 6,如需降级必须保留该备份。@@ -175,7 +174,7 @@ npm install -g @motrix/cli```bashmkdir -p motrix-data downloadssudo chown 1000:1000 motrix-data downloads-export MOTRIX_IMAGE='docker.io/motrixapp/motrix-server:2.4.4'+export MOTRIX_IMAGE='docker.io/motrixapp/motrix-server:2.4.5'export MOTRIX_PUBLIC_URL='http://nas.example.lan:8080'docker compose pull serverdocker compose up -d --waitdiff --git a/docs/release-notes/2.4.5.md b/docs/release-notes/2.4.5.mdnew file mode 100644index 00000000..1890a6c8--- /dev/null+++ b/docs/release-notes/2.4.5.md@@ -0,0 +1,39 @@+# Motrix 2.4.5++English | [简体中文](https://github.com/agalwood/Motrix/blob/main/docs/release-notes/2.4.5.zh-CN.md)++## Changes since 2.4.4++- Desktop now accepts recoverable handoffs from paired browser extensions by default. Browser Extension **0.1.25** negotiates this capability for eligible paused downloads. If the connection drops after submission, the extension can recover the existing task ID.+- Existing extensions and older hosts continue to support the original download submission method. To stop accepting new handoffs on Desktop, launch with `MOTRIX_DOWNLOAD_HANDOFF=0`; previously prepared operations can still finish.++## Upgrade compatibility++**Back up your profile and download files before upgrading.** The bundled engine+uses SQLite **schema 6**. When upgrading an older engine database, retain its+complete pre-upgrade backup; older engines cannot open schema 6. Stop all engines+before restoring a verified backup to a separate path for a downgrade. Do not+reset or delete the upgraded database as a substitute for recovery.++Users migrating from Motrix v1 should follow the+[migration guide](https://github.com/agalwood/Motrix/blob/v2.4.5/docs/legacy-migration.md)+and retain the original profile and engine database backups.++## Downloads and updates++Desktop packages support macOS 13 or later, Windows 10 or later, and Linux, with+native x64 and ARM64 builds. No 32-bit desktop packages are provided. Official+macOS packages require signing and notarization. Windows NSIS installers and ZIP+archives are unsigned and may trigger SmartScreen; use official Release downloads.++Stable publication updates both `latest*.yml` and `beta*.yml` feeds to 2.4.5.+Flatpak bundles and Native Host companions remain separate downloads. Snap+availability requires verified Store publication to edge and promotion of the+same amd64/arm64 revisions through candidate to stable.++Server images use `docker.io/motrixapp/motrix-server:2.4.5` and+`ghcr.io/agalwood/motrix-server:2.4.5`. After public multi-platform runtime+verification, `2.4`, `2`, `stable`, and `latest` advance to the same verified digest.+See the [Docker Server guide](https://github.com/agalwood/Motrix/blob/v2.4.5/docs/docker-server.md).++[Full changelog](https://github.com/agalwood/Motrix/compare/v2.4.4...v2.4.5)diff --git a/docs/release-notes/2.4.5.zh-CN.md b/docs/release-notes/2.4.5.zh-CN.mdnew file mode 100644index 00000000..aa7e5f1b--- /dev/null+++ b/docs/release-notes/2.4.5.zh-CN.md@@ -0,0 +1,36 @@+# Motrix 2.4.5++[English](https://github.com/agalwood/Motrix/blob/main/docs/release-notes/2.4.5.md) | 简体中文++## 相比 2.4.4 的变化++- 桌面端默认接受已配对扩展的账本交接。浏览器扩展 **0.1.25** 会为符合条件的已暂停下载协商此能力。提交后连接中断时,扩展可以找回已创建的任务。+- 旧扩展和旧宿主继续支持原有下载提交方式。需要暂时停用新交接时,可设置 `MOTRIX_DOWNLOAD_HANDOFF=0` 启动桌面端;已经准备好的操作仍可完成。++## 升级兼容性++**升级前请备份配置和下载文件。** 捆绑引擎使用 SQLite **schema 6**。+从旧版引擎数据库升级时,请保留完整的升级前备份;旧引擎无法打开 schema 6。+如需降级,应先停止所有引擎,再将验证过的备份恢复到单独路径。+不要通过重置或删除已升级数据库来代替恢复。++从 Motrix v1 迁移的用户应遵循+[迁移指南](https://github.com/agalwood/Motrix/blob/v2.4.5/docs/legacy-migration.zh-CN.md),+并保留原始配置及引擎数据库备份。++## 下载与更新++桌面安装包支持 macOS 13 及以上、Windows 10 及以上和 Linux,提供原生 x64 与 ARM64+构建,不提供 32 位桌面安装包。官方 macOS 安装包必须经过签名和公证。+Windows NSIS 安装程序和 ZIP 未签名,可能触发 SmartScreen;请使用官方 Release 下载。++正式发布会将 `latest*.yml` 和 `beta*.yml` 更新源同时更新至 2.4.5。+Flatpak 安装包和 Native Host 配套程序仍单独提供下载。Snap 可用性以验证后的 Store+发布为准:先发布至 edge,再将同一组 amd64/arm64 修订依次晋级至 candidate 和 stable。++Server 镜像使用 `docker.io/motrixapp/motrix-server:2.4.5` 和+`ghcr.io/agalwood/motrix-server:2.4.5`。公开镜像通过多平台运行验证后,+`2.4`、`2`、`stable` 和 `latest` 将指向同一已验证摘要。详见+[Docker Server 指南](https://github.com/agalwood/Motrix/blob/v2.4.5/docs/docker-server.zh-CN.md)。++[完整变更](https://github.com/agalwood/Motrix/compare/v2.4.4...v2.4.5)diff --git a/e2e/bridge/README.md b/e2e/bridge/README.mdindex 466615ca..1948c641 100644--- a/e2e/bridge/README.md+++ b/e2e/bridge/README.md@@ -303,4 +303,4 @@ To drive the same transaction from Chromium, also set `MOTRIX_EXTENSION_DIR` to### Local paired browser acceptance-From the extension checkout, set `MOTRIX_HOST_DIR` to this checkout and `MOTRIX_HANDOFF_SDK` to the installed SDK directory in the Motrix checkout (`node_modules/@motrix/mdxp`). Run `pnpm test:chromium-confirmation --paired-handoff` and `pnpm test:firefox-takeover --paired-handoff`. The extension drives the production MBP1 client against a separate loopback WebSocket bridge and the shared journal. An out-of-band test operator enters the host-generated code. Accepted transfers use a real aria2 engine; the lost-reply case closes the socket after commit and reconciles with status on a newly authenticated connection. The host fixture accepts only its generated loopback files and isolated output directory. Desktop registers the same module at startup. New preparations require MOTRIX_DOWNLOAD_HANDOFF=1. The desktop restart test also checks that a persisted operation drains with the gate off.+From the extension checkout, set `MOTRIX_HOST_DIR` to this checkout. Run `pnpm test:chromium-confirmation --paired-handoff` and `pnpm test:firefox-takeover --paired-handoff`. The extension drives the production MBP1 client against a separate loopback WebSocket bridge and the shared journal. An out-of-band test operator enters the host-generated code. Accepted transfers use a real aria2 engine; the lost-reply case closes the socket after commit and reconciles with status on a newly authenticated connection. The host fixture accepts only its generated loopback files and isolated output directory. Desktop registers the same module at startup. A fresh desktop profile accepts new handoffs by default. MOTRIX_DOWNLOAD_HANDOFF=0 drains existing operations. The desktop restart test also checks that a persisted operation drains with the gate off.diff --git a/e2e/bridge/README.zh-CN.md b/e2e/bridge/README.zh-CN.mdindex d6e4e9e5..9312cc55 100644--- a/e2e/bridge/README.zh-CN.md+++ b/e2e/bridge/README.zh-CN.md@@ -272,4 +272,4 @@ node --import tsx scripts/verify-local-download-handoff.mjs### 本地配对浏览器验收-从扩展仓库运行,将 `MOTRIX_HOST_DIR` 指向此仓库,`MOTRIX_HANDOFF_SDK` 指向 Motrix 工作目录中已安装的 SDK(`node_modules/@motrix/mdxp`),分别执行 `pnpm test:chromium-confirmation --paired-handoff` 和 `pnpm test:firefox-takeover --paired-handoff`。真实扩展 MBP1 客户端连接隔离的本机 WebSocket 桥,测试操作员从独立通道输入宿主生成的配对码。已接受任务由真实 aria2 下载;丢回执用例在 commit 后关闭连接,并通过重新认证的新连接查询原账本。测试宿主仅接收临时文件源和隔离目录。桌面端启动时注册同一个模块,新交接需设置 MOTRIX_DOWNLOAD_HANDOFF=1。桌面端重启测试还验证关闭开关后仍能完成先前已准备的交接。+从扩展仓库运行,将 `MOTRIX_HOST_DIR` 指向此仓库,分别执行 `pnpm test:chromium-confirmation --paired-handoff` 和 `pnpm test:firefox-takeover --paired-handoff`。真实扩展 MBP1 客户端连接隔离的本机 WebSocket 桥,测试操作员从独立通道输入宿主生成的配对码。已接受任务由真实 aria2 下载;丢回执用例在 commit 后关闭连接,并通过重新认证的新连接查询原账本。测试宿主仅接收临时文件源和隔离目录。桌面端启动时注册同一个模块,新配置默认接受交接,MOTRIX_DOWNLOAD_HANDOFF=0 可关闭新交接。桌面端重启测试还验证关闭开关后仍能完成先前已准备的交接。diff --git a/e2e/bridge/desktop-download-handoff.spec.ts b/e2e/bridge/desktop-download-handoff.spec.tsindex b2c4d005..919113f3 100644--- a/e2e/bridge/desktop-download-handoff.spec.ts+++ b/e2e/bridge/desktop-download-handoff.spec.ts@@ -21,7 +21,7 @@ import {} from '../fixtures/electron-app'test.use({ trace: 'off', screenshot: 'off' })-test('desktop resumes a prepared handoff after restart with new handoffs disabled', async ({+test('desktop accepts handoffs by default and drains an existing one after opt-out', async ({userDataDir,rpcPort,}) => {@@ -42,11 +42,11 @@ test('desktop resumes a prepared handoff after restart with new handoffs disableconst url = `http://127.0.0.1:${endpoint.port}/desktop.bin`await mkdir(path.join(userDataDir, 'downloads'), { recursive: true })let app: ElectronApplication | undefined- async function launch(enabled: boolean) {+ async function launch(override?: '0') {app = await launchMotrix({userDataDir,rpcPort,- extraEnv: { MOTRIX_DOWNLOAD_HANDOFF: enabled ? '1' : '0' },+ extraEnv: { MOTRIX_DOWNLOAD_HANDOFF: override },})const page = await app.firstWindow()await waitForEngineReady(page)@@ -56,7 +56,7 @@ test('desktop resumes a prepared handoff after restart with new handoffs disablereturn { app, page, port }}try {- const first = await launch(true)+ const first = await launch()const attempt = await startPair({port: first.port,origin,@@ -113,7 +113,7 @@ test('desktop resumes a prepared handoff after restart with new handoffs disableattempt.wire.ws.close()await first.app.close()app = undefined- const second = await launch(false)+ const second = await launch('0')const peer = await reconnect({port: second.port,origin,diff --git a/electron-builder.json b/electron-builder.jsonindex dfcfaeb2..154818cb 100644--- a/electron-builder.json+++ b/electron-builder.json@@ -91,8 +91,8 @@"category": "public.app-category.utilities","type": "distribution","artifactName": "${productName}-${version}-${arch}.${ext}",- "bundleShortVersion": "2.4.4",- "bundleVersion": "2.4.4",+ "bundleShortVersion": "2.4.5",+ "bundleVersion": "2.4.5","minimumSystemVersion": "13.0","hardenedRuntime": true,"gatekeeperAssess": false,diff --git a/electron-builder.signing.json b/electron-builder.signing.jsonindex b90b33c9..365715d4 100644--- a/electron-builder.signing.json+++ b/electron-builder.signing.json@@ -89,8 +89,8 @@"category": "public.app-category.utilities","type": "distribution","artifactName": "${productName}-${version}-${arch}.${ext}",- "bundleShortVersion": "2.4.4",- "bundleVersion": "2.4.4",+ "bundleShortVersion": "2.4.5",+ "bundleVersion": "2.4.5","minimumSystemVersion": "13.0","hardenedRuntime": true,"gatekeeperAssess": false,diff --git a/flatpak/app.motrix.native.metainfo.xml b/flatpak/app.motrix.native.metainfo.xmlindex 5c499650..4fc56e6f 100644--- a/flatpak/app.motrix.native.metainfo.xml+++ b/flatpak/app.motrix.native.metainfo.xml@@ -68,6 +68,9 @@</screenshots><releases>+ <release version="2.4.5" date="2026-11-20">+ <description><p>Enable recoverable handoff for paired local browser downloads by default.</p></description>+ </release><release version="2.4.4" date="2026-11-20"><description><p>Fixes stalls when adding torrents with many files. Updates MDXP to 0.10.0 and adds a SQLite ledger for paired download handoffs. Existing browser extensions retain their download submission flow.</p>diff --git a/package.json b/package.jsonindex f9728030..1d10936e 100644--- a/package.json+++ b/package.json@@ -3,7 +3,7 @@"type": "module","productName": "Motrix","homepage": "https://motrix.app",- "version": "2.4.4",+ "version": "2.4.5","packageManager": "[email protected]+sha512.66fd8278ee28935ce951792d34367ff3af5c432a2756445823029533835b8da529bbe0be5130afd56ed0713fb8789e47bad82d93bd5ae2fe54b15562d6276ef0","description": "A full-featured download manager","keywords": [],diff --git a/scripts/release-signing-input.mjs b/scripts/release-signing-input.mjsindex 5b39b466..40863b09 100644--- a/scripts/release-signing-input.mjs+++ b/scripts/release-signing-input.mjs@@ -47,7 +47,7 @@ const TRUSTED_INPUT_SHA256 = Object.freeze({'scripts/sign-macos.mjs':'98bda5c77dce2a3e5d9c9a2f8211f4d5594d060bf9d2839326db50dc41f8c58b','electron-builder.signing.json':- '08b5d1d3784c66ef0d89f3bc4eed8ec5879b69bfa4695190085329b901ef58b6',+ '6d7cc77596d7c8a764d0c90daa062505a440db3ad24fed3bf3b9fa1ca28a3702','signing-build-resources/256x256.png':'dcc14074b89edd296147ccd427e204e592c873cb2710eef539fabf2184ad0031','signing-build-resources/background.tiff':diff --git a/src/main/index.ts b/src/main/index.tsindex 9381421c..efaab3cf 100644--- a/src/main/index.ts+++ b/src/main/index.ts@@ -2145,7 +2145,8 @@ async function initializeMainProcess(): Promise<void> {if (!legacyImportService) motrixDb.init()try {- const enabled = process.env.MOTRIX_DOWNLOAD_HANDOFF === '1'+ const override = process.env.MOTRIX_DOWNLOAD_HANDOFF+ const enabled = override === undefined || override === '1'if (enabled ||motrixDb.database