You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While running a large static-analysis and test-writing experiment on master at commit f4a3596 (14 Sep 2026), we came across the bugs below. Each one was checked by hand against that commit; two of them (1 and 5) were also reproduced by tests. Line numbers refer to that commit, so some may have moved or been fixed since. I'm posting them together here because they are code-level findings rather than user reports; happy to open separate issues or PRs for any you want to track.
HTTP API
Every authenticated GET /Trailers returns 500.TrailersController forwards to an ItemsController created by dependency injection, which never gets the request's HttpContext. User is therefore null there, and ItemsController.cs#L263User.GetIsApiKey() throws NullReferenceException, even with an empty library. Reproduced with an integration test; GET /Items for the same user returns 200.
GetBitrateTestBytes sends a rented buffer it has already returned.MediaInfoController.cs#L334-L342: ArrayPool.Rent(size) can return a larger array, and the whole array is sent (size=102400 gives 131072 bytes); the array also goes back to the pool in finally before the FileContentResult is written, so another request can overwrite it while it is sent.
Guid.Parse on a client-supplied MediaSourceId.StreamingHelpers.cs#L135: when no media source matches a MediaSourceId that is not a GUID, Guid.Parse throws FormatException (500) instead of the request failing cleanly.
HLS: the default codec profiles never apply.DynamicHlsHelper.cs#L808 ends with ?? string.Empty, so profileString is never null and the ??= "high" / ??= "main" defaults on lines 811 and 818 are dead: a request naming no profile gets a CODECS string built with an empty profile.
WebSocket
Logging an invalid message reads a released buffer. In WebSocketConnection.cs#L201-L202, the JsonException handler calls reader.AdvanceTo(buffer.End) and then Encoding.UTF8.GetString(buffer); after AdvanceTo the buffer's memory may be recycled. A test sending invalid JSON hit ArgumentOutOfRangeException there. Logging before AdvanceTo avoids it.
Database migrations
FixPlaylistOwner aborts on read-only shares.20250420150000_FixPlaylistOwner.cs#L53: shares.First(x => x.CanEdit) throws InvalidOperationException for an ownerless playlist whose shares are all read-only; the is not null check on the next line shows FirstOrDefault was meant.
MigrateActivityLogDb stops early.20250420070000_MigrateActivityLogDb.cs#L115: when a row's UserId is an old Emby internal id that resolves in users.db, break leaves the whole read loop, so that row and every later one are not migrated.
MigrateEncodingOptions reads the wrong setting twice.MigrateEncodingOptions.cs#L83 and #L89 parse EncoderPreset and DeinterlaceMethod from oldConfig.TonemappingRange, so the user's old values for those two are lost.
MigrateDisplayPreferencesDb fails on an unknown Chromecast version.20250420120000_MigrateDisplayPreferencesDb.cs#L133: chromecastDict[version] throws KeyNotFoundException for any chromecastVersion custom pref other than stable / nightly / unstable.
Library, metadata and Live TV
Latest TV shows: a series with an undated newest episode throws.BaseItemRepository.Querying.cs#L343-L344: DateCreated ?? DateTime.MinValue followed by .AddHours(-RecentAdditionWindowHours) throws ArgumentOutOfRangeException when the newest episode of a series has a null DateCreated.
Search: the wildcard branch is unreachable.BaseItemRepository.TranslateQuery.cs#L264 looks for % _ [ ] ^ in cleanedSearchTerm, but GetCleanValue has already replaced every punctuation character with a space; the check probably meant originalSearchTerm.
Series detection tests the folder, not the file.SeriesResolver.cs#L136 calls VideoResolver.IsVideoFile(path, …) with the folder's path; fullName, the child file declared on the line above, is unused.
NFO: AddUserData can close the root element early. In BaseNfoSaver.cs#L912-L925, WriteStartElement("resume") is inside if (userdata is not null) but its WriteEndElement() is after the block: when GetUserData returns null, it closes the enclosing element instead.
WTV recordings: the premiere date is parsed from the wrong tag.ProbeResultNormalizer.cs#L1658 checks for WM/MediaOriginalBroadcastDateTime but calls DateTime.TryParse(year, …) instead of parsing premiereDateString.
XMLTV: ShowId is built from the episode number alone.XmlTvListingsProvider.cs#L246 and #L251 assign uniqueString = "-" + … where += was meant, so for programs without a programme id, different shows with the same season/episode number get the same ShowId.
Live TV: in-progress recordings always report 0% complete.LiveTvManager.cs#L625-L628 divides now - start by end (the end date's ticks, not the duration) in long arithmetic, so CompletionPercentage is always 0.
Network
TryParseHost("[::1]") drops the last character.NetworkUtils.cs#L309 recurses on host[1..(i - 1)], which for [::1] is ::, the case the method's own comment documents. The recursive call also drops the isIPv4Enabled / isIPv6Enabled arguments.
TryParseHost ignores isIPv6Enabled for IPv6 literals. The family filter on NetworkUtils.cs#L344-L345 is only in the hosts.Count <= 2 branch; an IPv6 literal splits into more parts and takes the else if branch at line 357, which returns it even when IPv6 is disabled.
IPData.AddressFamily never returns Unspecified.IPData.cs#L68 compares an AddressFamily with IPAddress.None (AddressFamily.Equals(IPAddress)), which is always false.
Plugins
The versioned plugin data folder fallback never runs.BasePluginOfT.cs#L51 tests Version is not null before SetAttributes (line 57) sets Version, so the _<version> folder is never tried.
For context: I work on NDepend, and these came out of several experiments where the tool had a coding agent fix static-analysis issues and write tests on Jellyfin. The agent flagged candidates and I verified the ones above by hand. The largest run fixed 1,514 issues, wrote 4,303 new tests (8,017 green in total), and took the code coverage from 31% to 56% (552 new source files including tests, 561 changed). Its full report is here, in case any of it is useful (the bugs are in the Potential bugs row of the AI Assistant tab): https://www.ndepend.com/Sample-Reports/OnJellyfinLarge/NDependReport.html?theme=light#ai-assistant
None of the code changes from those runs are proposed here, only the bugs.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Hi, and thanks for Jellyfin.
While running a large static-analysis and test-writing experiment on
masterat commitf4a3596(14 Sep 2026), we came across the bugs below. Each one was checked by hand against that commit; two of them (1 and 5) were also reproduced by tests. Line numbers refer to that commit, so some may have moved or been fixed since. I'm posting them together here because they are code-level findings rather than user reports; happy to open separate issues or PRs for any you want to track.HTTP API
Every authenticated
GET /Trailersreturns 500.TrailersControllerforwards to anItemsControllercreated by dependency injection, which never gets the request'sHttpContext.Useris therefore null there, andItemsController.cs#L263User.GetIsApiKey()throwsNullReferenceException, even with an empty library. Reproduced with an integration test;GET /Itemsfor the same user returns 200.GetBitrateTestBytessends a rented buffer it has already returned.MediaInfoController.cs#L334-L342:ArrayPool.Rent(size)can return a larger array, and the whole array is sent (size=102400gives 131072 bytes); the array also goes back to the pool infinallybefore theFileContentResultis written, so another request can overwrite it while it is sent.Guid.Parseon a client-suppliedMediaSourceId.StreamingHelpers.cs#L135: when no media source matches aMediaSourceIdthat is not a GUID,Guid.ParsethrowsFormatException(500) instead of the request failing cleanly.HLS: the default codec profiles never apply.
DynamicHlsHelper.cs#L808ends with?? string.Empty, soprofileStringis never null and the??= "high"/??= "main"defaults on lines 811 and 818 are dead: a request naming no profile gets a CODECS string built with an empty profile.WebSocket
WebSocketConnection.cs#L201-L202, theJsonExceptionhandler callsreader.AdvanceTo(buffer.End)and thenEncoding.UTF8.GetString(buffer); afterAdvanceTothe buffer's memory may be recycled. A test sending invalid JSON hitArgumentOutOfRangeExceptionthere. Logging beforeAdvanceToavoids it.Database migrations
FixPlaylistOwneraborts on read-only shares.20250420150000_FixPlaylistOwner.cs#L53:shares.First(x => x.CanEdit)throwsInvalidOperationExceptionfor an ownerless playlist whose shares are all read-only; theis not nullcheck on the next line showsFirstOrDefaultwas meant.MigrateActivityLogDbstops early.20250420070000_MigrateActivityLogDb.cs#L115: when a row's UserId is an old Emby internal id that resolves inusers.db,breakleaves the whole read loop, so that row and every later one are not migrated.MigrateEncodingOptionsreads the wrong setting twice.MigrateEncodingOptions.cs#L83and#L89parseEncoderPresetandDeinterlaceMethodfromoldConfig.TonemappingRange, so the user's old values for those two are lost.MigrateDisplayPreferencesDbfails on an unknown Chromecast version.20250420120000_MigrateDisplayPreferencesDb.cs#L133:chromecastDict[version]throwsKeyNotFoundExceptionfor anychromecastVersioncustom pref other than stable / nightly / unstable.Library, metadata and Live TV
Latest TV shows: a series with an undated newest episode throws.
BaseItemRepository.Querying.cs#L343-L344:DateCreated ?? DateTime.MinValuefollowed by.AddHours(-RecentAdditionWindowHours)throwsArgumentOutOfRangeExceptionwhen the newest episode of a series has a nullDateCreated.Search: the wildcard branch is unreachable.
BaseItemRepository.TranslateQuery.cs#L264looks for% _ [ ] ^incleanedSearchTerm, butGetCleanValuehas already replaced every punctuation character with a space; the check probably meantoriginalSearchTerm.Series detection tests the folder, not the file.
SeriesResolver.cs#L136callsVideoResolver.IsVideoFile(path, …)with the folder'spath;fullName, the child file declared on the line above, is unused.NFO:
AddUserDatacan close the root element early. InBaseNfoSaver.cs#L912-L925,WriteStartElement("resume")is insideif (userdata is not null)but itsWriteEndElement()is after the block: whenGetUserDatareturns null, it closes the enclosing element instead.WTV recordings: the premiere date is parsed from the wrong tag.
ProbeResultNormalizer.cs#L1658checks forWM/MediaOriginalBroadcastDateTimebut callsDateTime.TryParse(year, …)instead of parsingpremiereDateString.XMLTV:
ShowIdis built from the episode number alone.XmlTvListingsProvider.cs#L246and#L251assignuniqueString = "-" + …where+=was meant, so for programs without a programme id, different shows with the same season/episode number get the sameShowId.Live TV: in-progress recordings always report 0% complete.
LiveTvManager.cs#L625-L628dividesnow - startbyend(the end date's ticks, not the duration) inlongarithmetic, soCompletionPercentageis always 0.Network
TryParseHost("[::1]")drops the last character.NetworkUtils.cs#L309recurses onhost[1..(i - 1)], which for[::1]is::, the case the method's own comment documents. The recursive call also drops theisIPv4Enabled/isIPv6Enabledarguments.TryParseHostignoresisIPv6Enabledfor IPv6 literals. The family filter onNetworkUtils.cs#L344-L345is only in thehosts.Count <= 2branch; an IPv6 literal splits into more parts and takes theelse ifbranch at line 357, which returns it even when IPv6 is disabled.IPData.AddressFamilynever returnsUnspecified.IPData.cs#L68compares anAddressFamilywithIPAddress.None(AddressFamily.Equals(IPAddress)), which is always false.Plugins
BasePluginOfT.cs#L51testsVersion is not nullbeforeSetAttributes(line 57) setsVersion, so the_<version>folder is never tried.For context: I work on NDepend, and these came out of several experiments where the tool had a coding agent fix static-analysis issues and write tests on Jellyfin. The agent flagged candidates and I verified the ones above by hand. The largest run fixed 1,514 issues, wrote 4,303 new tests (8,017 green in total), and took the code coverage from 31% to 56% (552 new source files including tests, 561 changed). Its full report is here, in case any of it is useful (the bugs are in the Potential bugs row of the AI Assistant tab): https://www.ndepend.com/Sample-Reports/OnJellyfinLarge/NDependReport.html?theme=light#ai-assistant
None of the code changes from those runs are proposed here, only the bugs.
All reactions