[QSTR-222] Fix Synology DS2 task creation error 120#701
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the Synology Download Station client to dynamically set the task type to 'nzb' or 'bt' instead of hardcoding it to 'file', depending on whether the download type is 'usenet'. The corresponding regression test has also been updated. The reviewer suggested improving the robustness of this check by also verifying if the file name ends with '.nzb', since request.downloadType is optional and could be undefined.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
|
||
| if (apiName === "SYNO.DownloadStation2.Task") { | ||
| formData.append("type", "file"); | ||
| formData.append("type", request.downloadType === "usenet" ? "nzb" : "bt"); |
There was a problem hiding this comment.
Since request.downloadType is optional in DownloadRequest, it might be undefined. To make the task type detection more robust, we can also check if the resolved fileName ends with .nzb to determine if it should be "nzb" instead of defaulting to "bt".
const isNzb = request.downloadType === "usenet" || fileName.toLowerCase().endsWith(".nzb");
formData.append("type", isNzb ? "nzb" : "bt");There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c09c8a7996
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
/deploy tag=test-570 Deployment Summary
Pull and run the image:docker pull ghcr.io/Doezer/Questarr:$TAG
docker run -d -p 5000:5000 \
-e POSTGRES_PASSWORD=your_password \
-e IGDB_CLIENT_ID=your_client_id \
-e IGDB_CLIENT_SECRET=your_client_secret \
ghcr.io/Doezer/Questarr:$TAG |
44e4578 to
68e6a3c
Compare
|
/deploy tag=test-synology Deployment Summary
Pull and run the image:docker pull ghcr.io/Doezer/Questarr:$TAG
docker run -d -p 5000:5000 \
-e POSTGRES_PASSWORD=your_password \
-e IGDB_CLIENT_ID=your_client_id \
-e IGDB_CLIENT_SECRET=your_client_secret \
ghcr.io/Doezer/Questarr:$TAG |
|
/deploy tag=test-synology |
6403ed9 to
ff57a49
Compare
SYNO.DownloadStation2.Task.create requires type="bt" for torrent file uploads and type="nzb" for usenet, not the generic "file" value that was causing every file-upload task to be rejected with error code 120. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013qzSRa2VdVwiXP4pkGmmUw
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013qzSRa2VdVwiXP4pkGmmUw
@types/node-7z@2.1.11 types the old v2 API and wasn't resolving consistently between local and CI npm installs for node-7z@3.0.0, causing `tsc` to fail in CI (but not locally) with "could not find a declaration file for module 'node-7z'". Replace the mismatched @types package with an ambient declare module stub, matching the existing client/src/types/lucide-react.d.ts convention. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
ff57a49 to
0b1dee4
Compare
|
|
/deploy tag=test-synology Deployment Summary
Pull and run the image:docker pull ghcr.io/doezer/questarr:$TAG
docker run -d -p 5000:5000 \
-e POSTGRES_PASSWORD=your_password \
-e IGDB_CLIENT_ID=your_client_id \
-e IGDB_CLIENT_SECRET=your_client_secret \
ghcr.io/doezer/questarr:$TAGInspect the SBOM attestation:docker buildx imagetools inspect ghcr.io/doezer/questarr:$TAG --format '{{ json (index .SBOM "linux/amd64").SPDX }}' |
|
Linked to Plane Work Item(s) This comment was auto-generated by Plane |



This pull request makes substantial improvements to the Synology Download Station integration, aligning the implementation with the reverse-engineered, production-proven contract used by Prowlarr. It clarifies and codifies previously undocumented or misunderstood behaviors in both the code and documentation, ensuring robust support for both current and legacy Synology APIs. The changes also add comprehensive regression tests and update documentation to prevent future confusion.
The most important changes are:
Synology Download Station API contract alignment:
server/downloaders/synology.ts, including correct HTTP methods, parameter quoting, multipart field ordering, and session handling. This includes sending URL/magnet adds as GET requests, using JSON-quoted parameters and special field names for DS2 uploads, and moving_sidto the query string for DS2 POSTs. [1] [2] [3] [4]Documentation and decision tracking:
docs/synology-download-station-api-notes.mdexplaining the undocumented behaviors, rationale for implementation choices, and fallback strategies for future debugging.memory/decisions.md, including context and rationale.Test coverage and regression prevention:
server/__tests__/downloaders_synology_remaining.test.ts,downloaders_clients_regression.test.ts, anddownloaders.test.tsto verify correct API usage, parameter quoting, multipart field order, and session handling for both DS2 and legacy endpoints. [1] [2] [3] [4]Code cleanup:
@types/node-7zdependency frompackage.json.These changes ensure that the Synology Download Station integration is robust, maintainable, and based on the best available evidence from real-world deployments.