A full-featured download manager.
chore(release): prepare 2.2.1 (#2493)
Dr_rOote004e9f71f3a
diff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlindex 10324c4c..70dc5f2d 100644--- a/.github/workflows/release.yml+++ b/.github/workflows/release.yml@@ -940,7 +940,7 @@ jobs:EXPECTED_COMMIT: ${{ github.sha }}EXPECTED_PLATFORM: ${{ matrix.platform }}# Updated only after reviewing the verifier source itself.- VERIFIER_SHA256: 3bb037cd537f6bfa1a5c1bb545495f448d5dcb3e8e05acafdafab89ee8eb00ec+ VERIFIER_SHA256: 8fd4fb2064007fb0206be663952f6b9ce805d9797067846f60739ecdb1424501run: |const crypto = require('node:crypto')const fs = require('node:fs')diff --git a/README.md b/README.mdindex 8e9ca962..7a5e1eed 100644--- a/README.md+++ b/README.md@@ -19,21 +19,23 @@ 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.2.0--Motrix 2.2.0 restores optional Dock and taskbar progress, enables extension-media downloads on Server, and strengthens torrent metadata validation. It also-improves browser-profile isolation, cookie handoff, and download compatibility.-Download [v2.2.0 from GitHub Releases](https://github.com/agalwood/Motrix/releases/tag/v2.2.0)-and read the [full release notes](./docs/release-notes/2.2.0.md).--Back up your existing Motrix profile and downloads before upgrading. The desktop-Migration Assistant imports selected v1 tasks as paused records and preserves-the original files. Resuming downloads requires a separate explicit action.-Windows in-place BitTorrent activation requires a supported local NTFS volume-and explicit authorization. See the [migration guide](./docs/legacy-migration.md)-for supported volumes, file permissions, and recovery. Keep the v1 profile and-the engine's pre-upgrade database backup.+## Motrix 2.2.1++Motrix 2.2.1 fixes startup recovery for broken magnet sessions and restores safe+HTTP retries with the original task and download progress when the engine has+retained the required context. It bundles aria2 1.37.0-motrix.22 and fixes stale+retry actions after Web UI session changes.+Download [v2.2.1 from GitHub Releases](https://github.com/agalwood/Motrix/releases/tag/v2.2.1)+and read the [full release notes](./docs/release-notes/2.2.1.md).++Back up your existing Motrix profile and downloads before upgrading. The bundled+engine upgrades its SQLite database to schema 6 and keeps a pre-upgrade backup;+older engines cannot open schema 6. Keep that backup if you may need to downgrade.+The desktop Migration Assistant imports selected v1 tasks as paused records and+preserves the original files. Resuming downloads requires a separate explicit+action. Windows in-place BitTorrent activation requires a supported local NTFS+volume and explicit authorization. See the [migration guide](./docs/legacy-migration.md)+for supported volumes, file permissions, and recovery. Keep the original v1 profile.## Screenshots@@ -185,7 +187,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.2.0'+export MOTRIX_IMAGE='docker.io/motrixapp/motrix-server:2.2.1'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 9c09f40f..c0015220 100644--- a/README.zh-CN.md+++ b/README.zh-CN.md@@ -19,18 +19,20 @@ Motrix 是一款界面简洁、功能丰富的桌面下载管理器,可处理- **桌面应用**:可在 macOS、Windows 和 Linux 上运行;- **Headless server**:无需桌面环境,可直接使用 Node.js 运行或通过 Docker 部署,并提供 Web 界面,适合安装在 NAS 和家庭服务器上。-## Motrix 2.2.0+## Motrix 2.2.1-Motrix 2.2.0 恢复可选的 Dock 与任务栏进度显示,接通 Server 扩展媒体下载,-并加强种子元数据校验,同时改进浏览器配置文件隔离、Cookie 传递和下载兼容性。-从 GitHub Releases 下载 [v2.2.0](https://github.com/agalwood/Motrix/releases/tag/v2.2.0),-并阅读[完整发布说明](./docs/release-notes/2.2.0.zh-CN.md)。+Motrix 2.2.1 修复损坏磁力任务会话导致的启动问题,并在引擎保留了所需上下文时,+使用原任务和已有下载进度安全重试 HTTP 下载。本版捆绑 aria2 1.37.0-motrix.22,+同时修复 Web UI 会话变化后仍执行旧重试操作的问题。+从 GitHub Releases 下载 [v2.2.1](https://github.com/agalwood/Motrix/releases/tag/v2.2.1),+并阅读[完整发布说明](./docs/release-notes/2.2.1.zh-CN.md)。-升级前请备份现有 Motrix 配置和下载文件。桌面端迁移助手会将选中的 v1 任务-导入为暂停记录,并保留原文件;恢复下载需要单独明确操作。-Windows 原位激活 BitTorrent 任务要求使用受支持的本地 NTFS 卷,并明确授权。-支持的磁盘类型、文件权限和恢复方式见[迁移指南](./docs/legacy-migration.zh-CN.md)。-请保留 v1 配置和引擎升级前数据库快照的备份。+升级前请备份现有 Motrix 配置和下载文件。捆绑引擎会将 SQLite 数据库升级至+schema 6,并保留升级前备份;旧引擎无法打开 schema 6,如需降级必须保留该备份。+桌面端迁移助手会将选中的 v1 任务导入为暂停记录,并保留原文件;恢复下载需要+单独明确操作。Windows 原位激活 BitTorrent 任务要求使用受支持的本地 NTFS 卷,+并明确授权。支持的磁盘类型、文件权限和恢复方式见+[迁移指南](./docs/legacy-migration.zh-CN.md)。请保留原始 v1 配置。## 应用截图@@ -174,7 +176,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.2.0'+export MOTRIX_IMAGE='docker.io/motrixapp/motrix-server:2.2.1'export MOTRIX_PUBLIC_URL='http://nas.example.lan:8080'docker compose pull serverdocker compose up -d --waitdiff --git a/docs/legacy-migration.md b/docs/legacy-migration.mdindex 15a85d37..6f257a17 100644--- a/docs/legacy-migration.md+++ b/docs/legacy-migration.md@@ -44,8 +44,9 @@ invalidates recovery; putting an old file back does not revive an invalidatedgrant. If an activation response is lost, Motrix reconciles its saved token andGID instead of blindly creating a duplicate task.-Retain the engine's `*.pre-schema5-*.db` backup when upgrading an old database.-It contains the state before the schema upgrade. An older engine cannot open the-newer schema; stop all engines and restore a verified backup to a separate path-if a downgrade is necessary. Existing released engines and application packages+Retain the engine’s pre-upgrade database backups, including backups from earlier+upgrades. The engine bundled with Motrix 2.2.1 upgrades an existing database to+schema 6; older engines cannot open it. Stop all engines and restore a verified+pre-upgrade backup to a separate path if a downgrade is necessary. Do not delete+or reset the upgraded database. Existing released engines and application packagesare immutable; support depends on the engine bundled with the installed build.diff --git a/docs/legacy-migration.zh-CN.md b/docs/legacy-migration.zh-CN.mdindex 2aaa45e1..71eef8f1 100644--- a/docs/legacy-migration.zh-CN.md+++ b/docs/legacy-migration.zh-CN.md@@ -33,6 +33,7 @@ reparse point、硬链接文件、备用数据流和别名路径会被拒绝。已失效的授权。激活响应丢失时,Motrix 会核对已保存的 token 和 GID,避免盲目创建重复任务。-升级旧数据库时,请保留引擎的 `*.pre-schema5-*.db` 备份。备份记录的是升级前状态。-旧引擎无法打开新 schema;如需降级,请停止所有引擎,将经过验证的备份恢复到独立-路径。已发布的引擎和应用安装包保持不变,功能支持取决于所安装版本捆绑的引擎。+请保留引擎生成的升级前数据库备份,包括更早升级留下的备份。Motrix 2.2.1+捆绑的引擎会将现有数据库升级至 schema 6,旧引擎无法打开该格式。如需降级,+请停止所有引擎,将经过验证的升级前备份恢复到独立路径,不要删除或重置已升级的+数据库。已发布的引擎和应用安装包保持不变,功能支持取决于所安装版本捆绑的引擎。diff --git a/docs/release-notes/2.2.1.md b/docs/release-notes/2.2.1.mdnew file mode 100644index 00000000..cf051670--- /dev/null+++ b/docs/release-notes/2.2.1.md@@ -0,0 +1,75 @@+# Motrix 2.2.1++English | [简体中文](https://github.com/agalwood/Motrix/blob/v2.2.1/docs/release-notes/2.2.1.zh-CN.md)++Motrix 2.2.1 fixes startup recovery for broken magnet sessions and HTTP retries+that previously lost their original request context or download progress.++## Changes since 2.2.0++- Keep a magnet task with missing torrent metadata or a deleted download directory+ from blocking engine startup. Recover from hash-verified application metadata+ where possible; otherwise, back up the engine database and retain the affected+ task as a removable error. Healthy tasks can start, repeated launches do not+ recreate deleted directories, and unrelated task history is preserved. Also+ prevent verified old metadata history from reappearing as an extra HTTP task.+- Retry eligible failed HTTP downloads using the original task, engine GID,+ output path, request options, cookies and checkpoint. Retain the required engine+ context across restarts, including explicitly empty cookie jars. The engine+ checks the original resource identity before reusing partial data; credentials+ stay in the engine and are not copied into application task records. Restored+ failures still require an explicit Retry. Alt+Retry keeps the form for editing+ a new download request.+- Discard pending Retry availability responses after Web UI logout,+ reauthentication, or loss of connection readiness, so an old response cannot+ reopen a cleared dialog or dispatch a previous retry request.+- Update the packaged engine to **aria2 1.37.0-motrix.22**, including the HTTP+ continuation contract and stricter handling of malformed torrent piece lengths+ and empty input-file lines. Native packaging checks exercise real-engine+ continuation and session recovery on all six desktop targets.+- Carry forward the Snap publication recovery fixes: verify and reuse accepted+ package hashes, preserve each architecture’s revision independently, and+ release only the complete verified build set.++Electron remains **45.2.1** and `vscode-jsonrpc` remains **9.0.3**.++## Upgrade and retry compatibility++**Back up your profile and download files before upgrading.** The new engine+upgrades its SQLite database to **schema 6**, preserving a complete pre-upgrade+backup, including committed WAL data. Older engines cannot open schema 6. If a+downgrade is necessary, stop all engines and restore a verified pre-upgrade backup+to a separate path; do not delete or reset the upgraded database. Keep backups+from earlier upgrades as well.++Original-task HTTP continuation requires SQLite persistence, a supporting engine,+and historical request/resource context captured for that task. Previously deleted+cookies or missing historical validators cannot be reconstructed. Older tasks and+custom engines without the required capability may still use the existing+fresh-download parameter form. Changed or unverifiable resources are not silently+resumed with old partial bytes. This release does not claim to resolve every+site-specific authentication failure; [#2426](https://github.com/agalwood/Motrix/issues/2426)+and [#2488](https://github.com/agalwood/Motrix/issues/2488) remain open for user verification.++Users migrating from Motrix v1 should follow the+[migration guide](https://github.com/agalwood/Motrix/blob/v2.2.1/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.2.1.+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.2.1` and+`ghcr.io/agalwood/motrix-server:2.2.1`. After public multi-platform runtime+verification, `2.2`, `2`, `stable`, and `latest` advance to the same verified digest.+See the [Docker Server guide](https://github.com/agalwood/Motrix/blob/v2.2.1/docs/docker-server.md).++[Full changelog](https://github.com/agalwood/Motrix/compare/v2.2.0...v2.2.1)diff --git a/docs/release-notes/2.2.1.zh-CN.md b/docs/release-notes/2.2.1.zh-CN.mdnew file mode 100644index 00000000..ef52d5f9--- /dev/null+++ b/docs/release-notes/2.2.1.zh-CN.md@@ -0,0 +1,61 @@+# Motrix 2.2.1++[English](https://github.com/agalwood/Motrix/blob/v2.2.1/docs/release-notes/2.2.1.md) | 简体中文++Motrix 2.2.1 修复损坏磁力任务会话导致的启动问题,以及 HTTP 重试时丢失原始请求+上下文或下载进度的问题。++## 相比 2.2.0 的改动++- 磁力任务的种子元数据或下载目录缺失时,不再阻止引擎启动。能找到经过哈希校验的+ 应用元数据时尝试恢复;否则先备份引擎数据库,再将受影响任务保留为可移除的错误+ 记录。其他正常任务可以启动,反复启动不会重建已删除目录,无关任务历史会保留。+ 同时防止已确认的旧元数据历史在恢复后变成多余的 HTTP 任务。+- 对符合条件的失败 HTTP 下载,使用原任务、引擎 GID、输出路径、请求选项、Cookie+ 和检查点重试。所需引擎上下文可跨重启保留,包括明确为空的 Cookie 状态。复用已有+ 下载数据前,引擎会检查原资源身份;凭据保留在引擎中,不会复制到应用任务记录。+ 重启后恢复的失败任务仍需用户明确点击重试;Alt+重试保留编辑新下载请求的参数表单。+- 在退出或重新登录 Web UI、连接失去就绪状态后,丢弃尚未完成的重试可用性查询结果,+ 防止旧响应重新打开已清除的对话框,或执行上一个会话的重试请求。+- 捆绑引擎更新至 **aria2 1.37.0-motrix.22**,包含 HTTP 续传契约,以及对异常种子+ 分片长度和空输入文件行的处理修复。原生打包检查在六个桌面目标上执行真实引擎的+ 续传与会话恢复测试。+- 纳入 Snap 发布恢复流程修复:按包哈希验证并复用已接受的 revision,分别保存各架构+ 的上传记录,仅发布完整且验证通过的双架构产物。++Electron 保持 **45.2.1**,`vscode-jsonrpc` 保持 **9.0.3**。++## 升级与重试兼容性++**升级前请备份配置和下载文件。** 新引擎会将 SQLite 数据库升级至 **schema 6**,+并保留包含已提交 WAL 数据的完整升级前备份。旧引擎无法打开 schema 6;如需降级,+请停止所有引擎,将经过验证的升级前备份恢复到独立路径,不要删除或重置已升级的+数据库,也请保留更早升级留下的备份。++原任务 HTTP 续传要求启用 SQLite 持久化、使用支持该能力的引擎,并且任务已保存+历史请求和资源上下文。已经删除的 Cookie 或缺失的历史资源校验信息无法重建。+旧任务以及不支持该能力的自定义引擎,仍可能使用原有的新下载参数表单。资源发生+变化或无法验证时,不会直接拿旧的部分文件继续下载。本版不承诺解决所有网站的+认证问题;[#2426](https://github.com/agalwood/Motrix/issues/2426) 和+[#2488](https://github.com/agalwood/Motrix/issues/2488) 仍保留以等待用户验证。++从 Motrix v1 迁移的用户请阅读+[迁移指南](https://github.com/agalwood/Motrix/blob/v2.2.1/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.2.1。Flatpak 包和+Native Host 配套组件仍单独提供下载。Snap 需要先通过 Store 的 edge 发布验证,再将+同一组 amd64/arm64 revision 依次晋级 candidate 和 stable 后才可用。++Server 镜像使用 `docker.io/motrixapp/motrix-server:2.2.1` 和+`ghcr.io/agalwood/motrix-server:2.2.1`。通过公开多平台运行验证后,`2.2`、`2`、+`stable`、`latest` 别名会推进至同一已验证摘要。使用方法见+[Docker Server 指南](https://github.com/agalwood/Motrix/blob/v2.2.1/docs/docker-server.zh-CN.md)。++[完整变更](https://github.com/agalwood/Motrix/compare/v2.2.0...v2.2.1)diff --git a/electron-builder.json b/electron-builder.jsonindex 63b60135..5cf173d0 100644--- a/electron-builder.json+++ b/electron-builder.json@@ -90,8 +90,8 @@"category": "public.app-category.utilities","type": "distribution","artifactName": "${productName}-${version}-${arch}.${ext}",- "bundleShortVersion": "2.2.0",- "bundleVersion": "2.2.0",+ "bundleShortVersion": "2.2.1",+ "bundleVersion": "2.2.1","minimumSystemVersion": "13.0","hardenedRuntime": true,"gatekeeperAssess": false,diff --git a/electron-builder.signing.json b/electron-builder.signing.jsonindex 29c00215..992f4cfc 100644--- a/electron-builder.signing.json+++ b/electron-builder.signing.json@@ -88,8 +88,8 @@"category": "public.app-category.utilities","type": "distribution","artifactName": "${productName}-${version}-${arch}.${ext}",- "bundleShortVersion": "2.2.0",- "bundleVersion": "2.2.0",+ "bundleShortVersion": "2.2.1",+ "bundleVersion": "2.2.1","minimumSystemVersion": "13.0","hardenedRuntime": true,"gatekeeperAssess": false,diff --git a/flatpak/app.motrix.native.metainfo.xml b/flatpak/app.motrix.native.metainfo.xmlindex c82bd57a..d96554e3 100644--- a/flatpak/app.motrix.native.metainfo.xml+++ b/flatpak/app.motrix.native.metainfo.xml@@ -68,6 +68,16 @@</screenshots><releases>+ <release version="2.2.1" date="2026-11-03">+ <description>+ <p>+ Fixes startup recovery for broken magnet sessions and safe continuation+ of retained HTTP tasks. Prevents stale retries after Web UI session+ changes and bundles aria2 1.37.0-motrix.22. Keep the engine's pre-upgrade+ database backup: older engines cannot open schema 6.+ </p>+ </description>+ </release><release version="2.2.0" date="2026-11-01"><description><p>diff --git a/package.json b/package.jsonindex f33c9017..c8c1b710 100644--- a/package.json+++ b/package.json@@ -3,7 +3,7 @@"type": "module","productName": "Motrix","homepage": "https://motrix.app",- "version": "2.2.0",+ "version": "2.2.1","packageManager": "[email protected]+sha512.091d1dee7927575661b25dab3c2ae31cafc1c54d6b71ed6a6600cf0c1cb10434a447eae14015f1b23e2e6bedeed79df94a932e2164d2832280dce3fb32f656d1","description": "A full-featured download manager","keywords": [],diff --git a/scripts/release-signing-input.mjs b/scripts/release-signing-input.mjsindex f8a6840f..37b37072 100644--- a/scripts/release-signing-input.mjs+++ b/scripts/release-signing-input.mjs@@ -41,7 +41,7 @@ const TRUSTED_INPUT_SHA256 = Object.freeze({'scripts/sign-macos.mjs':'98bda5c77dce2a3e5d9c9a2f8211f4d5594d060bf9d2839326db50dc41f8c58b','electron-builder.signing.json':- 'b0eb0e9704ab452da41468d7f0a7345062002be6a082fe5d4cca4d9a02399d98',+ '6ab284b126989f1524c8389f821045d4e588f5600913bf0d99e512fe775d7951','signing-build-resources/256x256.png':'044d3b64a14aa512ca41469372d1ad630557daaeb2cb4e709d34f2d3c57d4c3b','signing-build-resources/background.tiff':diff --git a/src/core/task/direct-task-retry.integration.test.ts b/src/core/task/direct-task-retry.integration.test.tsindex b93819c4..effaf165 100644--- a/src/core/task/direct-task-retry.integration.test.ts+++ b/src/core/task/direct-task-retry.integration.test.ts@@ -258,10 +258,13 @@ describe.skipIf(!requireNativeHttpRetry && !nativeRetryEnvironmentAvailable)(downloadedBytes: Number(failed.completedLength),})expect(persisted).toHaveBeenCalled()- expect(await readFile(original.diskPath)).toEqual(payload)- expect(- (await readFile(original.diskPath)).subarray(0, before.length)- ).toEqual(before)+ const downloaded = await readFile(original.diskPath)+ // Compare every byte natively. Deep object equality walks millions of+ // Buffer properties and can exhaust the test deadline on Intel CI.+ expect(downloaded.equals(payload)).toBe(true)+ expect(downloaded.subarray(0, before.length).equals(before)).toBe(+ true+ )expect(requests.slice(mark)