Skip to content

fix(sonarr): unblock DELETE_SHOW_IF_EMPTY and surface cleanup skips#2763

Merged
enoch85 merged 1 commit into
developmentfrom
fix/sonarr-delete-show-if-empty-silent-bail
Apr 24, 2026
Merged

fix(sonarr): unblock DELETE_SHOW_IF_EMPTY and surface cleanup skips#2763
enoch85 merged 1 commit into
developmentfrom
fix/sonarr-delete-show-if-empty-silent-bail

Conversation

@enoch85

@enoch85 enoch85 commented Apr 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes #2757. DELETE_SHOW_IF_EMPTY silently bailed when Seerr was configured but the show wasn't tracked in Seerr, or when all Seerr requests were already COMPLETED. The bail paths also had no logs, so users had nothing to debug with.

Fix

  • hasRemainingSeasonRequests: return false when mediaInfo is null (show not tracked in Seerr — nothing to protect), keep undefined only for real communication failures.
  • Outer request filter now also excludes COMPLETED requests.
  • Add debug log at every bail path in deleteShowIfEmpty / unmonitorShowIfEmptyAndEnded.
  • Spec coverage for untracked show, empty requests, comm failure, Seerr state unknown, and files-still-remain.

PR #2618's design intent (Seerr is the authority when configured, ended shows included) is preserved.

Test plan

  • yarn test --filter=@maintainerr/server — 1017 pass
  • yarn lint — clean
  • Manual: ended + empty show not tracked in Seerr → deletes
  • Manual: continuing show with a Pending/Approved request for another season → not deleted
  • Manual: Seerr unreachable → not deleted (debug log explains why)

DELETE_SHOW_IF_EMPTY silently bailed when Seerr was configured but
the show was not tracked in Seerr, and when every remaining Seerr
request was already COMPLETED. hasRemainingSeasonRequests returned
undefined for missing mediaInfo the same way it does for real
communication errors, and the outer request filter kept COMPLETED
requests in scope so their seasons were still scanned.

- Treat a Seerr response with no mediaInfo as "nothing to protect"
  (returns false); keep undefined strictly for communication errors.
- Exclude COMPLETED requests at the outer filter so fulfilled
  history does not block deletion.
- Add a debug log at every bail path in deleteShowIfEmpty and
  unmonitorShowIfEmptyAndEnded so users can see why a show was kept.
- Add spec coverage for: untracked show, empty requests,
  communication failure, Seerr state unknown from the handler, and
  files-still-remain.

The PR #2618 design intent (Seerr is the authority when configured,
ended shows included) is preserved.

Fixes #2757
@enoch85 enoch85 added this to the 3.8.0 milestone Apr 24, 2026
@enoch85 enoch85 merged commit cba195e into development Apr 24, 2026
13 checks passed
@enoch85 enoch85 deleted the fix/sonarr-delete-show-if-empty-silent-bail branch April 24, 2026 21:09
maintainerr-automation Bot added a commit that referenced this pull request Apr 24, 2026
* fix(sonarr): unblock DELETE_SHOW_IF_EMPTY and surface cleanup skips (#2763)

DELETE_SHOW_IF_EMPTY silently bailed when Seerr was configured but
the show was not tracked in Seerr, and when every remaining Seerr
request was already COMPLETED. hasRemainingSeasonRequests returned
undefined for missing mediaInfo the same way it does for real
communication errors, and the outer request filter kept COMPLETED
requests in scope so their seasons were still scanned.

- Treat a Seerr response with no mediaInfo as "nothing to protect"
  (returns false); keep undefined strictly for communication errors.
- Exclude COMPLETED requests at the outer filter so fulfilled
  history does not block deletion.
- Add a debug log at every bail path in deleteShowIfEmpty and
  unmonitorShowIfEmptyAndEnded so users can see why a show was kept.
- Add spec coverage for: untracked show, empty requests,
  communication failure, Seerr state unknown from the handler, and
  files-still-remain.

The PR #2618 design intent (Seerr is the authority when configured,
ended shows included) is preserved.

Fixes #2757

* Add token for GitHub authentication in workflow

Added token usage for authentication in docs drift workflow.

* ci(docs-drift): remove create_pr step and input

The draft PR was empty scaffolding — the drift issue already carries
the same report and is the canonical tracking surface. Drop the unused
create_pr dispatch input and the push/PR creation step.

* ci(stale): use GITHUB_TOKEN for stale-issue bot

The job already requests issues: write, which GITHUB_TOKEN satisfies —
no need for the ACTIONS_TOKEN PAT. Dropping this removes the last
workflow reference to ACTIONS_TOKEN.

---------

Co-authored-by: enoch85 <mailto@danielhansson.nu>
@maintainerr-automation

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.8.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Unmonitor and delete season + delete show if empty" action not removing ended series from Sonarr

1 participant