Skip to content

fix(media-request-subscriber): update the parent status of the request even if *arr failed#2462

Open
gauthier-th wants to merge 1 commit intodevelopfrom
fix-retry-status
Open

fix(media-request-subscriber): update the parent status of the request even if *arr failed#2462
gauthier-th wants to merge 1 commit intodevelopfrom
fix-retry-status

Conversation

@gauthier-th
Copy link
Member

@gauthier-th gauthier-th commented Feb 16, 2026

Description

This PR adds a separate try/catch block around the sendTo*arr functions to ensure that the updateParentStatus is updated even if sending the request failed.

This should resolve a bug where a request stays FAILED while its associated media has been marked as AVAILABLE.

How Has This Been Tested?

Not tested. Check #2409.

Checklist:

  • I have read and followed the contribution guidelines.
  • Disclosed any use of AI (see our policy)
  • I have updated the documentation accordingly.
  • All new and existing tests passed.
  • Successful build pnpm build
  • Translation keys pnpm i18n:extract
  • Database migration (if required)

Summary by CodeRabbit

  • Refactor
    • Improved error handling and logging for media request processing with separate error tracking for different operations, providing clearer visibility into failures when sending requests or updating status.

@gauthier-th gauthier-th requested a review from a team as a code owner February 16, 2026 16:47
@coderabbitai
Copy link

coderabbitai bot commented Feb 16, 2026

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Walkthrough

Error handling in the MediaRequestSubscriber is refactored to separate concerns. The afterUpdate and afterInsert hooks now use distinct try-catch blocks for media request sending operations versus parent status updates, with dedicated logging for each failure type.

Changes

Cohort / File(s) Summary
Error Handling Restructuring
server/subscriber/MediaRequestSubscriber.ts
Split error handling in afterUpdate and afterInsert hooks into separate try-catch blocks for sending requests versus updating parent status. Added granular logging: "Error while sending to \*arr" and "Error while updating parent status" for each operation type.
Dependency Updates
package.json
Package manifest updated (+31/-7).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 Error paths now split with care,
No single catch for all despair,
When Radarr fails or status lags,
Each path its own debugging tags!
Little fixes, logs so clear,
Make the rabbit's heart so dear! 🌟

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Title accurately summarizes the main change: restructuring error handling to ensure updateParentStatus executes even when sending to *arr fails.
Linked Issues check ✅ Passed The code changes directly address issue #2409 by separating error handling so updateParentStatus executes independently, allowing request status updates even when *arr sends fail.
Out of Scope Changes check ✅ Passed All changes are focused on error handling restructuring in MediaRequestSubscriber.ts and are directly scoped to resolving issue #2409.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into develop

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a bug where media requests would remain in FAILED status even after the associated media becomes AVAILABLE on Jellyfin. The fix separates error handling for sending requests to *arr services from updating parent status, ensuring that the parent status update executes even when *arr services fail.

Changes:

  • Split try-catch blocks in afterUpdate and afterInsert methods to isolate *arr service errors from parent status updates
  • Improved error logging with specific messages for each operation (sending to *arr vs. updating parent status)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gauthier-th
Copy link
Member Author

Preview tag: preview-test-retry

@gauthier-th gauthier-th added the preview PRs deployed for testing with tag `:preview-prxx` label Feb 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preview PRs deployed for testing with tag `:preview-prxx`

Projects

None yet

Development

Successfully merging this pull request may close these issues.

After a failed attempt, if the media is available on the Jellyfin server and show available on Jellyseerr, the filter available is not working

1 participant