Skip to content

[NEEDS CODE REVIEWER] fix: Skip stale queue items during unmonitored checks - #371

Merged
jrhager84 merged 1 commit into
devfrom
fix/issue-341-stale-queue
Jul 13, 2026
Merged

[NEEDS CODE REVIEWER] fix: Skip stale queue items during unmonitored checks#371
jrhager84 merged 1 commit into
devfrom
fix/issue-341-stale-queue

Conversation

@jrhager84

Copy link
Copy Markdown
Collaborator

Summary

Prevents a stale queue item from crashing Decluttarr when its referenced detail item no longer exists in the configured Arr instance.

  • Treats a 404 returned while checking monitored status as a stale queue record
  • Logs which download and detail item were skipped
  • Continues processing the remaining queue
  • Re-raises non-404 HTTP errors instead of hiding unrelated failures
  • Preserves the existing shared-download behavior by treating the stale record as non-removable

Closes #341

Test plan

  • Stale queue item returning 404 is skipped
  • Remaining unmonitored items are still detected
  • Warning identifies the stale download and detail item
  • Non-404 HTTP errors are re-raised
  • pytest tests/jobs/test_remove_unmonitored.py tests/settings/test_instances.py tests/jobs/test_job_manager.py
  • Black and isort checks

@lolimmlost lolimmlost left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Treating stale 404s as "monitored" is the right safe default -- preserves the shared-download guard (won't remove unless ALL queue items are verified unmonitored). Re-raise on non-404 is correct.

Non-blocking: make_request logs at ERROR before re-raising, so a stale 404 produces both an ERROR from make_request and a WARNING from the new handler. The ERROR is misleading since the situation is handled. Not worth changing is_monitored for this PR, but worth noting if the noise becomes a problem.

LGTM.

@jrhager84
jrhager84 force-pushed the fix/issue-341-stale-queue branch from 20f9923 to 105584a Compare July 13, 2026 22:11
@jrhager84
jrhager84 merged commit 4bfd163 into dev Jul 13, 2026
4 checks passed
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.

Readarr 404 on stale queue item crashes decluttarr instead of skipping the item

2 participants