Skip to content

Handle qBittorrent accepted-but-unverified adds to avoid false 500 failures#643

Open
Copilot wants to merge 6 commits into
release/1.4.0from
copilot/fix-internal-error-500
Open

Handle qBittorrent accepted-but-unverified adds to avoid false 500 failures#643
Copilot wants to merge 6 commits into
release/1.4.0from
copilot/fix-internal-error-500

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 27, 2026

In some UNRAID/Docker setups, qBittorrent returns Ok. for URL-based torrent add, but Questarr fails immediate verification and then hits a 500 from indexer fallback download, resulting in a false "All downloaders failed" response. This change preserves success semantics when qBittorrent has already accepted the add.

  • Downloader behavior: accepted-but-unverified path

    • In QBittorrentClient.addDownload, track when non-magnet URL add returns Ok. but no torrent is immediately observable.
    • If fallback .torrent fetch fails afterward, return success (accepted by qBittorrent) instead of surfacing a hard failure.
  • Failure-mode handling

    • Restricts this behavior to the specific non-magnet case where qBittorrent explicitly acknowledged URL add.
    • Keeps existing magnet behavior and fallback logic unchanged for other error paths.
  • Regression coverage

    • Added focused test for: URL add Ok. → verification miss → fallback fetch 500 → operation treated as accepted.
if (urlAddAcceptedButUnverified) {
  return {
    success: true,
    message: "Download accepted by qBittorrent but could not be verified immediately",
  };
}

Copilot AI changed the title [WIP] Fix internal error 500 during downloading Handle qBittorrent accepted-but-unverified adds to avoid false 500 failures May 27, 2026
Copilot finished work on behalf of Doezer May 27, 2026 21:20
Copilot AI requested a review from Doezer May 27, 2026 21:20
@Doezer
Copy link
Copy Markdown
Owner

Doezer commented May 27, 2026

/deploy tag=test-qbit-500

@Doezer Doezer added this to Questarr May 28, 2026
@github-project-automation github-project-automation Bot moved this to Backlog in Questarr May 28, 2026
@Doezer Doezer moved this from Backlog to Waiting for release in Questarr May 28, 2026
@Doezer Doezer moved this from Waiting for release to In review in Questarr May 28, 2026
@Doezer Doezer added this to the 1.4.0 milestone May 28, 2026
@Doezer Doezer marked this pull request as ready for review May 31, 2026 14:53
@Doezer Doezer force-pushed the copilot/fix-internal-error-500 branch from e4dae83 to d300032 Compare June 1, 2026 06:04
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 1, 2026

Codecov Report

❌ Patch coverage is 82.97872% with 8 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
server/downloaders/qbittorrent.ts 82.97% 8 Missing ⚠️

📢 Thoughts on this report? Let us know!

@Doezer
Copy link
Copy Markdown
Owner

Doezer commented Jun 1, 2026

/deploy tag=test-qbit-500

@Doezer
Copy link
Copy Markdown
Owner

Doezer commented Jun 1, 2026

/deploy tag=test-qbit-500

@Doezer
Copy link
Copy Markdown
Owner

Doezer commented Jun 1, 2026

/deploy tag=test-qbit-500

Deployment Summary

  • Environment: test
  • Image: ghcr.io/Doezer/Questarr
  • Docker Hub: doezer/questarr
  • Tags: ghcr.io/doezer/questarr:test-qbit-500
    ghcr.io/doezer/questarr:test-sha-ade8b11
    doezer/questarr:test-qbit-500
    doezer/questarr:test-sha-ade8b11

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

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 1, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot
15.8% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In review

2 participants