A full-featured download manager.
fix(engine): restore cloud-drive directory downloads (#2503)
Dr_rOotf76ec09e6e92
diff --git a/.github/workflows/flatpak.yml b/.github/workflows/flatpak.ymlindex a44686dc..3978fab5 100644--- a/.github/workflows/flatpak.yml+++ b/.github/workflows/flatpak.yml@@ -301,7 +301,7 @@ jobs:-path "*/native-messaging-hosts/*" \\) -print -quit)"output="$("$aria2c" --version)"- printf "%s\n" "$output" | grep -qF "aria2 version 1.37.0-motrix.22"+ printf "%s\n" "$output" | grep -qF "aria2 version 1.37.0-motrix.23"printf "%s\n" "$output" | grep -qF "Async DNS"printf "%s\n" "$output" | grep -qF "BitTorrent"printf "%s\n" "$output" | grep -qF "HTTPS"diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.mdindex 11ea48f5..87375e34 100644--- a/THIRD_PARTY_NOTICES.md+++ b/THIRD_PARTY_NOTICES.md@@ -102,8 +102,8 @@ must obtain permission or replace the font before distributing the build.Desktop builds bundle an `aria2c` executable pinned by`scripts/engine.lock.json`:-- **Version:** 1.37.0-motrix.22-- **Source:** <https://github.com/motrixapp/aria2/tree/v1.37.0-motrix.22>+- **Version:** 1.37.0-motrix.23+- **Source:** <https://github.com/motrixapp/aria2/tree/v1.37.0-motrix.23>- **License:** GNU General Public License v2.0 or later (`GPL-2.0-or-later`)- **Full license text:** `THIRD_PARTY_LICENSES/aria2-COPYING`- **OpenSSL exception / notice:**diff --git a/THIRD_PARTY_NOTICES.zh-CN.md b/THIRD_PARTY_NOTICES.zh-CN.mdindex 444db5a5..5675cc89 100644--- a/THIRD_PARTY_NOTICES.zh-CN.md+++ b/THIRD_PARTY_NOTICES.zh-CN.md@@ -87,8 +87,8 @@ Safari 图标是从 macOS 27.0(26A428)自带的 Safari 27.0 中 `Safari.app/桌面版随应用打包 `aria2c` 可执行文件,版本由 `scripts/engine.lock.json` 固定:-- **版本:** 1.37.0-motrix.22-- **对应源码:** <https://github.com/motrixapp/aria2/tree/v1.37.0-motrix.22>+- **版本:** 1.37.0-motrix.23+- **对应源码:** <https://github.com/motrixapp/aria2/tree/v1.37.0-motrix.23>- **许可证:** GNU General Public License v2.0 or later(`GPL-2.0-or-later`)- **完整许可证文本:** `THIRD_PARTY_LICENSES/aria2-COPYING`- **OpenSSL 例外条款 / 声明:**diff --git a/flatpak/app.motrix.native.yml b/flatpak/app.motrix.native.ymlindex aacb90b7..163ba472 100644--- a/flatpak/app.motrix.native.yml+++ b/flatpak/app.motrix.native.yml@@ -101,7 +101,7 @@ modules:set -eoutput="$(src/aria2c --version)"printf '%s\n' "$output"- printf '%s\n' "$output" | grep -qF 'aria2 version 1.37.0-motrix.22'+ printf '%s\n' "$output" | grep -qF 'aria2 version 1.37.0-motrix.23'for feature in \'Async DNS' \'BitTorrent' \@@ -123,8 +123,8 @@ modules:sources:- type: giturl: https://github.com/motrixapp/aria2.git- tag: v1.37.0-motrix.22- commit: 96b49bb471c82d414c760bb67dd6085607174d7e+ tag: v1.37.0-motrix.23+ commit: 7d318fcff6d2f00feddbe6ce81b0c89c808dfc15x-checker-data:type: gittag-pattern: ^v([\d.]+-motrix\.\d+)$@@ -136,9 +136,9 @@ modules:commands:- |sed -i -E \- 's/AC_INIT\(\[aria2\],\[[^]]+\]/AC_INIT([aria2],[1.37.0-motrix.22]/' \+ 's/AC_INIT\(\[aria2\],\[[^]]+\]/AC_INIT([aria2],[1.37.0-motrix.23]/' \configure.ac- grep -qF 'AC_INIT([aria2],[1.37.0-motrix.22]' configure.ac+ grep -qF 'AC_INIT([aria2],[1.37.0-motrix.23]' configure.ac- type: scriptdest-filename: autogen.shcommands:diff --git a/scripts/engine.lock.json b/scripts/engine.lock.jsonindex a73c1890..e62207b0 100644--- a/scripts/engine.lock.json+++ b/scripts/engine.lock.json@@ -1,56 +1,56 @@{"engine": "aria2","repo": "motrixapp/aria2",- "tag": "v1.37.0-motrix.22",- "version": "1.37.0-motrix.22",+ "tag": "v1.37.0-motrix.23",+ "version": "1.37.0-motrix.23","assets": {"darwin-arm64": {- "file": "aria2c-1.37.0-motrix.22-darwin-arm64.tar.gz",+ "file": "aria2c-1.37.0-motrix.23-darwin-arm64.tar.gz","bin": "aria2c",- "archiveSha256": "a64ccdd642ba5b28d638c8202c224b8d04c5750945bc292845119bfe30676ce3",- "binarySha256": "120b87705dc3fbf7ad75241e50243a48a6fa854001f03b3d1adff8a3715cd8d2"+ "archiveSha256": "e9aec22f19c96aa4f285f6db334926f0688754febc451668be1b93643a2e608a",+ "binarySha256": "265a7bc6c42491d476ae394b4fe9c5af12aefbd0aecaf3463d5eedb326550ff4"},"darwin-x64": {- "file": "aria2c-1.37.0-motrix.22-darwin-x64.tar.gz",+ "file": "aria2c-1.37.0-motrix.23-darwin-x64.tar.gz","bin": "aria2c",- "archiveSha256": "28467f11ee0f89469214119236ee6640ff6f7fdc5ea99b89b6be081581f29fd5",- "binarySha256": "a3657c91607e0aacf02d49ba2a35270fb89afcaebbbd666bda4873dec68f561d"+ "archiveSha256": "d124737e2f2993c47d15d0364d0f69806ff2fdf1e75484a96388832cb1cf715a",+ "binarySha256": "285e21954cdf2f97442df92a72d9bbf8c1e2b8e0b07e55a3a2a6420823ace808"},"win32-arm64": {- "file": "aria2c-1.37.0-motrix.22-win32-arm64.zip",+ "file": "aria2c-1.37.0-motrix.23-win32-arm64.zip","bin": "aria2c.exe",- "archiveSha256": "17b3b651ed636d2e2d24557d6c9a190ad130bc930b6ed17c0bb6f2e0119c847e",- "binarySha256": "b4a0c774b9ea3f6b035541dd82a37fb46e0ad7cd505ead7e51cfa4542bc8ee4d"+ "archiveSha256": "92bd41b06c3fdf6e1e419f4230924b02948305b380af715d24c622f1e5c85173",+ "binarySha256": "0efd7d885fa2845f5c6665510a01049ce50bfbcbe5c8be702fab40bc8242d69c"},"win32-x64": {- "file": "aria2c-1.37.0-motrix.22-win32-x64.zip",+ "file": "aria2c-1.37.0-motrix.23-win32-x64.zip","bin": "aria2c.exe",- "archiveSha256": "c078ce68ee38bf07e297c3930d6ed721e9acaff8826b2464a5fc22a8e7279058",- "binarySha256": "8692cb34ebfba1ebddd693caf36f124d68cfa1b8489400e03b0a4aad1d9555bb"+ "archiveSha256": "107f5784ffd99e10eeb31297b3d71cda7f0e14f940863d27ddd5215644623825",+ "binarySha256": "ab33a0b5249b97ce1da4a8705c27588e74449f684fd92340db5de85dfcbf5ffa"},"win32-ia32": {- "file": "aria2c-1.37.0-motrix.22-win32-ia32.zip",+ "file": "aria2c-1.37.0-motrix.23-win32-ia32.zip","bin": "aria2c.exe",- "archiveSha256": "0406abe25e94a3f376a36cf61ca294f9ab19505e2ec0acb28a9f8a2f313642c4",- "binarySha256": "1196116e6c3856f6674459193227e99d1ddd99db1187bb9aab382fb5bc4c4250"+ "archiveSha256": "2efc2064d2a5b91a3308e5e54c24467ee2b6d823fadaef178c55f83cf94e67d0",+ "binarySha256": "9a873918aacc5ed18fa21dc8d5b7c3ea9cb42cc015f34f836418aaaf36308cfc"},"linux-x64": {- "file": "aria2c-1.37.0-motrix.22-linux-x64.tar.gz",+ "file": "aria2c-1.37.0-motrix.23-linux-x64.tar.gz","bin": "aria2c",- "archiveSha256": "b4ef94ba6843c4ef445365174219478a79e8f87a3f9f06de4a5081da04814505",- "binarySha256": "6896a9cc11471711260cc8e9a06f1ab6fe215de2084ad99ad5a28cee68e776a8"+ "archiveSha256": "23844251c9712ea10d5add8721f9081f9c9a53d3ff4ce5e664f7e3b27c10c7d4",+ "binarySha256": "1f5c5100220997b186657de142bff0a43032ae7e24fb357d8f6a38bd6d0b3286"},"linux-arm64": {- "file": "aria2c-1.37.0-motrix.22-linux-arm64.tar.gz",+ "file": "aria2c-1.37.0-motrix.23-linux-arm64.tar.gz","bin": "aria2c",- "archiveSha256": "c064e5b0e55092dbf98e5d810cf185b96164483230e20b29c1f51dbaf01e2b53",- "binarySha256": "d04d1c45957171df28b38a5422a67477b11a623ea4c2f9fe0ee158e7993d9da3"+ "archiveSha256": "8aa829367cc78c69140a55393ff992281c31e42c6e76e5c4853eaa5aa79d1146",+ "binarySha256": "53c2b1879a020c619a780de652a45deac5ad892e994f31204d315c480e1a246c"},"linux-arm": {- "file": "aria2c-1.37.0-motrix.22-linux-armv7l.tar.gz",+ "file": "aria2c-1.37.0-motrix.23-linux-armv7l.tar.gz","bin": "aria2c",- "archiveSha256": "a6017e41333606c3b757d4425f7fd2cb75cad62905151b7a388026bc7d532685",- "binarySha256": "26e92762af4483660779b5d515443bb800b5938c0a067f539dd9cc6961d38c9b"+ "archiveSha256": "c6cf08a069658cc730d2c4039e50897d57e2ca02ba8be27367f1a871c2905ee0",+ "binarySha256": "81fd2b866c9550c7b8dd644ae5663c86a6d1d2749ca4dd5e1cd529fe8d010d32"}}}diff --git a/scripts/verify-flatpak-packaging.mjs b/scripts/verify-flatpak-packaging.mjsindex fd9f7585..2d3075f4 100644--- a/scripts/verify-flatpak-packaging.mjs+++ b/scripts/verify-flatpak-packaging.mjs@@ -18,8 +18,8 @@ export const FLATPAK_BUILDER_TOOLS_COMMIT =// tag resolves to is pinned by hand (and cross-checked against the manifest).export const ARIA2_SOURCE = Object.freeze({url: 'https://github.com/motrixapp/aria2.git',- // v1.37.0-motrix.22 — current Motrix aria2 fork release- commit: '96b49bb471c82d414c760bb67dd6085607174d7e',+ // v1.37.0-motrix.23 — current Motrix aria2 fork release+ commit: '7d318fcff6d2f00feddbe6ce81b0c89c808dfc15',})const PNPM_SOURCE = Object.freeze({diff --git a/src/core/engine/aria2/aria2-adapter.integration.test.ts b/src/core/engine/aria2/aria2-adapter.integration.test.tsindex b33bec76..eb70faf9 100644--- a/src/core/engine/aria2/aria2-adapter.integration.test.ts+++ b/src/core/engine/aria2/aria2-adapter.integration.test.ts@@ -7,8 +7,10 @@// them directly rather than duplicating them under `__fixtures__/` to keep// the repo small; the PoC fixtures total ~1.5 MB of binary data.+import { once } from 'node:events'import { mkdtempSync, readFileSync, rmSync } from 'node:fs'import fs from 'node:fs/promises'+import { createServer } from 'node:http'import { tmpdir } from 'node:os'import path from 'node:path'import { TaskStatus } from '@shared/types/task'@@ -97,6 +99,49 @@ describe.skipIf(!bundledAria2Exists() || !canBindLoopbackTcp())(}})+ it('keeps cloud-drive RPC output and task paths under the download directory', async () => {+ const payload = Buffer.from('cloud-drive nested output\n')+ const server = createServer((_request, response) => {+ response.writeHead(200, { 'Content-Length': payload.length })+ response.end(payload)+ })+ let gid: string | undefined+ try {+ server.listen(0, '127.0.0.1')+ await once(server, 'listening')+ const address = server.address()+ if (!address || typeof address === 'string') {+ throw new Error('No HTTP fixture port')+ }+ // External clients reach aria2 directly and may include a leading+ // slash in the cloud path. They do not use createDownload's filename.+ gid = await rpc.addUri(+ [`http://127.0.0.1:${address.port}/payload.bin`],+ { out: '/cloud/多层目录/payload.bin', pause: 'true' }+ )+ const target = path.join(baseDir, 'cloud/多层目录/payload.bin')+ const queued = await adapter.getTaskStatus(gid)+ expect(queued).not.toBeNull()+ // Assert before starting so an incompatible engine cannot write to+ // an absolute path outside the fixture's download directory.+ expect(path.resolve(queued!.diskPath)).toBe(target)+ await rpc.unpause(gid)+ const completed = await waitFor(async () => {+ const task = await adapter.getTaskStatus(gid!)+ expect(task?.status).not.toBe(TaskStatus.Error)+ return task?.status === TaskStatus.Completed ? task : null+ }, 5000)+ expect(path.resolve(completed.diskPath)).toBe(target)+ expect(path.resolve(completed.finalPath)).toBe(target)+ expect(completed.saveDir).toBe(baseDir)+ expect(await fs.readFile(target)).toEqual(payload)+ } finally {+ if (gid) await discardTask(adapter, gid)+ server.closeAllConnections()+ await new Promise<void>((resolve) => server.close(() => resolve()))+ }+ }, 10_000)+it('PoC-1: bt-seed-unverified reaches seeding/complete without hash verify', async () => {// Stage the pre-completed torrent data so aria2 has nothing to fetch.const stagingDir = path.join(baseDir, 'poc1-staging')diff --git a/src/renderer/routes/plugins/plugin-diagnostics-page.test.tsx b/src/renderer/routes/plugins/plugin-diagnostics-page.test.tsxindex a858cfe0..b9b755d8 100644--- a/src/renderer/routes/plugins/plugin-diagnostics-page.test.tsx+++ b/src/renderer/routes/plugins/plugin-diagnostics-page.test.tsx@@ -565,7 +565,7 @@ describe('PluginDiagnosticsPage', () => {})).toBeInTheDocument()expect(- screen.getByText(/plugin\.removed Not installed/)+ await screen.findByText(/plugin\.removed Not installed/)).toBeInTheDocument()})diff --git a/tests/check-third-party-notices.test.ts b/tests/check-third-party-notices.test.tsindex bdf61aef..46d8440d 100644--- a/tests/check-third-party-notices.test.ts+++ b/tests/check-third-party-notices.test.ts@@ -460,9 +460,9 @@ describe('third-party graph dependency notices', () => {expect(notice).toContain('SFNS-Regular.ttf')expect(notice).toContain('https://developer.apple.com/fonts/')- expect(notice).toContain('1.37.0-motrix.22')+ expect(notice).toContain('1.37.0-motrix.23')expect(notice).toContain(- 'https://github.com/motrixapp/aria2/tree/v1.37.0-motrix.22'+ 'https://github.com/motrixapp/aria2/tree/v1.37.0-motrix.23')expect(notice).toContain('GPL-2.0-or-later')expect(notice).toContain('THIRD_PARTY_LICENSES/aria2-COPYING')diff --git a/tests/generate-third-party-notices.test.ts b/tests/generate-third-party-notices.test.tsindex 7376179d..ba8aaab4 100644--- a/tests/generate-third-party-notices.test.ts+++ b/tests/generate-third-party-notices.test.ts@@ -194,7 +194,7 @@ describe('third-party notice generator', () => {expect(bundle.packageCount).toBeGreaterThan(100)expect(inventory).toContain('| @xyflow/react | 12.12.0 |')- expect(inventory).toContain('| aria2 | 1.37.0-motrix.22 |')+ expect(inventory).toContain('| aria2 | 1.37.0-motrix.23 |')expect(inventory).toContain('| motrix.filename-template | 1.1.1 |')expect(inventory).toContain('Apple San Francisco tray font')expect(licenses).toContain('GNU GENERAL PUBLIC LICENSE')@@ -305,7 +305,7 @@ describe('third-party notice generator', () => {expect(licenses).toContain('GNU GENERAL PUBLIC LICENSE')}const serverInventory = server.files['THIRD_PARTY_DEPENDENCIES.md']- expect(serverInventory).toContain('| aria2 | 1.37.0-motrix.22 |')+ expect(serverInventory).toContain('| aria2 | 1.37.0-motrix.23 |')expect(serverInventory).toContain('| motrix.filename-template | 1.1.1 |')expect(serverInventory).not.toContain('| Electron |')