mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-16 05:43:54 +03:00
[PR #15956] [MERGED] fix: Handle unknown item types gracefully in DeserializeBaseItem #14477
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/jellyfin/jellyfin/pull/15956
Author: @ZeusCraft10
Created: 1/6/2026
Status: ✅ Merged
Merged: 1/9/2026
Merged by: @Bond-009
Base:
master← Head:fix/issue-15945-unknown-type-deserialization📝 Commits (1)
0ff869dfix: Handle unknown item types gracefully in DeserializeBaseItem📊 Changes
3 files changed (+100 additions, -19 deletions)
View changed files
📝
Jellyfin.Server.Implementations/Item/BaseItemRepository.cs(+23 -17)📝
Jellyfin.Server/Migrations/Routines/MigrateLibraryDb.cs(+5 -2)➕
tests/Jellyfin.Server.Implementations.Tests/Item/BaseItemRepositoryTests.cs(+72 -0)📄 Description
The Problem
I reproduced issue #15945 where querying /Items\ with
ecursive=true\ and \isLocked=false\ throws a 500 error. After digging into it, I found that the root cause is in \DeserializeBaseItem\ - when an item has a type that can't be resolved (like from a plugin that was removed), it throws an \InvalidOperationException\ instead of handling it gracefully.
What I Changed
The fix is pretty straightforward - instead of throwing when we encounter an unknown type, we now:
ull\ instead of crashing
This follows the same pattern that's already used for JSON deserialization errors a few lines down - log and continue rather than blow up the whole request.
Changes
Testing
Fixes #15945
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.