Skip to content

fix(sabnzbd): fail closed when an action response carries no status flag - #97

Open
ndandan wants to merge 2 commits into
Shoshuo:mainfrom
ndandan:fix/sabnzbd-fail-closed
Open

fix(sabnzbd): fail closed when an action response carries no status flag#97
ndandan wants to merge 2 commits into
Shoshuo:mainfrom
ndandan:fix/sabnzbd-fail-closed

Conversation

@ndandan

@ndandan ndandan commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

SabnzbdClient::action() (pause / resume / delete / speed-limit / add) determined success with return ($data['status'] ?? true) !== false;. Because an absent status key defaulted to true, any unrecognised HTTP 200 — from a reverse proxy, an auth portal, or a different SABnzbd version — was reported to the user as a successful action even though nothing happened.

Pure SABnzbd actions always carry a status flag. Its absence is now treated as failure and logged (via the client's existing LoggerInterface), matching NzbgetClient's existing === true strictness. call() was promoted privateprotected as a minimal seam for the test double.

Covered by a new SabnzbdActionResultTest (status true/false/absent).

ndandan and others added 2 commits August 21, 2026 21:59
action() defaulted an absent `status` key to true, so any unrecognised
200 (proxy, different SABnzbd version) was reported as a successful
pause/resume/delete/speed-limit/add. Pure actions always carry status;
its absence is now treated as failure and logged, matching NzbgetClient's
existing `=== true` strictness.

call() promoted private -> protected (minimal seam for the test double).
SabnzbdClient already holds a LoggerInterface, so the anomaly is logged
via the existing $this->logger rather than adding a new dependency.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

1 participant