Skip to content

fix(availability-sync): prevent incorrect season deletion when media server is unreachable#2302

Merged
0xSysR3ll merged 1 commit intodevelopfrom
fallenbagel/fix/availability-sync-season-removal
Jan 16, 2026
Merged

fix(availability-sync): prevent incorrect season deletion when media server is unreachable#2302
0xSysR3ll merged 1 commit intodevelopfrom
fallenbagel/fix/availability-sync-season-removal

Conversation

@fallenbagel
Copy link
Copy Markdown
Collaborator

@fallenbagel fallenbagel commented Jan 16, 2026

Description

Fixes an issue where media availability sync would incorrectly mark seasons as deleted when the media server (Plex/Jellyfin/Emby) is temporarily unreachable, even when the media still exists in Sonarr. The bug was caused by faulty season map merging logic that prevented Sonarr's results from overriding the initial "not found" state, combined with incorrect error handling in the Jellyfin implementation. This caused the watchlist sync to recreate requests for already-available media when the media server went offline. The fix restores the original Overseerr map merging behavior and corrects Jellyfin's error handling to fail-safe when the server is unreachable.

How Has This Been Tested?

Screenshots / Logs (if applicable)

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)

…server is unreachable

Fixes season map merging logic to allow sonarr results to override initial false values. Fixes
jellyfin error handling to fail-safe (assume media exists) on connection errors. Fix incorrect
boolean logic in jellyfin 404/500 checks.

fix #2296
Copy link
Copy Markdown
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 pull request fixes a critical bug where the availability sync incorrectly marks TV seasons as deleted when the media server (Plex/Jellyfin/Emby) becomes temporarily unreachable, even though the media still exists in Sonarr. The fix restores proper fail-safe behavior and corrects the map merging logic to prioritize data sources correctly.

Changes:

  • Simplified and corrected the season map merging logic to use spread operator syntax, ensuring proper priority order (filtered → media server → Sonarr)
  • Fixed Jellyfin error handling logic to correctly detect non-404/non-500 errors and fail-safe by assuming media exists when the server is unreachable

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

@fallenbagel fallenbagel added severity: critical bug Something isn't working labels Jan 16, 2026
@0xSysR3ll 0xSysR3ll merged commit 448a25e into develop Jan 16, 2026
18 checks passed
@0xSysR3ll 0xSysR3ll deleted the fallenbagel/fix/availability-sync-season-removal branch January 16, 2026 09:47
0xSysR3ll pushed a commit to 0xSysR3ll/jellyseerr that referenced this pull request Jan 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working severity: critical

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deleted request is recreated when Plex is down Re-requests every monday 05:10

4 participants