Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(qBittorrent): API Version state handling #826

Merged
merged 1 commit into from
Nov 25, 2024

Conversation

LXGaming
Copy link
Contributor

Description

When Flood is started before a qBittorrent 5 client, starting and stopping torrents will fail due to the wrong method being called.

This is happening due to Flood getting the API Version in the clientRequestManager constructor (clientRequestManager.ts#L626) and nowhere else. If this request fails then the apiVersion will remain null until Flood is restarted.

I made the apiVersion consistent with the authCookie so that it's kept in sync with the qBittorrent client and can be awaited to ensure the value is resolved. I also renamed updateAuthCookie to updateConnection so that it better represents what the method is now doing.

As getApiVersion requires authentication I've chained the promises so that it runs only when authenticate is successful.

The changes to clientGatewayService are to make the calls to isApiVersionAtLeast consistent with clientRequestManager.

Related Issue

#820

Screenshots

Types of changes

  • Breaking change (changes that break backward compatibility of public API or CLI - semver MAJOR)
  • New feature (non-breaking change which adds functionality - semver MINOR)
  • Bug fix (non-breaking change which fixes an issue - semver PATCH)

@LXGaming
Copy link
Contributor Author

Force push to correct the commit summary and to resolve the linting fail.

Copy link

codecov bot commented Nov 25, 2024

Codecov Report

Attention: Patch coverage is 86.20690% with 4 lines in your changes missing coverage. Please review.

Project coverage is 72.95%. Comparing base (aae3d3c) to head (f0e428a).
Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
...erver/services/qBittorrent/clientRequestManager.ts 82.60% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #826      +/-   ##
==========================================
- Coverage   72.97%   72.95%   -0.02%     
==========================================
  Files          66       66              
  Lines       11468    11482      +14     
  Branches      977      980       +3     
==========================================
+ Hits         8369     8377       +8     
- Misses       3085     3089       +4     
- Partials       14       16       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@trim21 trim21 merged commit 80825db into jesec:master Nov 25, 2024
19 checks passed
@LXGaming LXGaming deleted the fix/qb-api branch November 25, 2024 05:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants