Repository navigation
fix(jellycompat): send every field Jellyfin includes in the sign-in response - #3144
Conversation
…esponse Lenna and other clients with strict JSON decoders reject the AuthenticateByName response when a key Jellyfin always sends is missing. The response now includes the full policy lists, the user's login and activity dates, and a complete SessionInfo with device details taken from the MediaBrowser authorization header. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
There was a problem hiding this comment.
Actionable comments posted: 1

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
e6fef9d3-e347-42f3-b5a0-b10e079ee7f6
Files selected for processing: 2-
internal/jellycompat/handlers_auth.gointernal/jellycompat/handlers_auth_body_test.go
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
-
SessionInfo.Id was derived from the user and DeviceId, so every sign-in that named no device returned the same Id for that user. Such a sign-in now gets a random Id; sign-ins that name a device keep the stable one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
|
Major change — Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed. Posted via Macroscope — v1 validation impact |
|
Should be ready to review. Thanks |
…tries A sign-in without a DeviceId got a random SessionInfo.Id, so asking AuthenticateWithQuickConnect again with the same secret returned the same session under a new Id. The Id now derives from the login session, which the retry shares, and stays distinct between sign-ins. The test drops a check that could never fail (a hex Id cannot contain "tok"), and SyncPlayAccess uses a named constant instead of a nolint comment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Quick104
left a comment
There was a problem hiding this comment.
Review of 4c09891. The approach holds up: the sign-in response now matches Jellyfin's key set, and every new value fits the Kotlin and Swift SDK models I checked. Three small findings below, none blocking. I'm fixing all three in a commit on this branch, so there's no need to change anything yourself.
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Review summaryReviewed head: a825f9e (your 4c09891 plus one review-fix commit). The change is sound. The sign-in response now carries the keys Jellyfin always sends, and the new values fit the Kotlin SDK models that Findroid and Jellyfin for Android TV use, as well as the Swift models. The policy lists are empty arrays, and Addressed in a825f9e
Left for maintainers (not blocking)
Validated features: Cross-provider review: one round with Codex (gpt-6.1-sol). It raised the two items above under Left for maintainers, plus the Quick Connect retry Id, which is fixed. It found no client-decoding, privacy, or multi-node problems. User manual: unaffected. The Jellyfin apps page doesn't describe sign-in response fields. Adding Lenna to its list of checked apps can wait for a validated run. Apple/Android parity: not applicable. This changes only the Jellyfin-compatible surface, and Silo's own apps don't use it. Fit: 9/10 · Readiness: 9/10 — ready (assuming CI is green)
|
Problem
Related issue: N/A
Validation tasks: changes #1246 C1 (adds fields to the sign-in response that Jellyfin Web, Findroid, and Jellyfin for Android TV read)
Lenna 1.0.17, an iOS Jellyfin and Emby client, cannot sign in to Silo.
POST /Users/AuthenticateByNamereturns 200 with a token, but Lenna shows "JSON Decode Error: … The data couldn't be read because it is missing." That is Swift's error when a required key is absent, so Lenna discards the session.Silo's sign-in response leaves out keys that Jellyfin always sends. This change adds them so strict decoders accept the response.
Approach
The compat sign-in response now carries every key Jellyfin's
AuthenticationResultsends for a new session:User.Policysends its list fields as[]instead of omitting them, and gainsAccessSchedulesandBlockUnratedItems.UsergainsEnableAutoLogin,LastLoginDate, andLastActivityDate.SessionInfogainsId,Client,DeviceId,DeviceName,ApplicationVersion,RemoteEndPoint,PlayState,Capabilities,AdditionalUsers, andNowPlayingQueue. The device fields come from the request'sMediaBrowserauthorization header.Idis derived from the user and device ID, never from the access token.Lenna is closed source, so the exact key it requires is unknown. Matching Jellyfin's full response covers it without guessing. The same user DTO serves
/Users/Me,/Users, and/Users/{id}, so those responses gain the same fields. The change is additive: no field is removed or changes meaning. No native API, Apple, or Android client change is needed.Validation
go build,go vet,gofmt,make lint-changed,make lint-router-recovery, andmake verify-local-pathspass.make test-gopasses except for five tests inmetadata/nfo,scanner, andsubtitles/subsync, which fail the same way onmainon the macOS dev machine (filename case and non-UTF-8 name handling).make verify-route-inventoryandmake verify-bidicould not run locally (cgo type-check and the localgit grepregex); CI covers both. This change adds no routes.main(23 missing keys) and passes with this change.Evidence
Evidence: none, no user-visible change in Silo's own apps. The visible effect is Lenna signing in; a screenshot will be added after testing against this build.
Before:


Done on Build 3e2d306
After:


Done on Build 3e2d306+dirty
Risks
None identified. Clients that ignore unknown keys see no difference.
RemoteEndPointechoes the caller's own address back to it, as Jellyfin does.Checklist
AI Disclosure
Note
Send all Jellyfin-required fields in jellycompat sign-in response
userDTOResponse,userPolicyResponse, andsessionInfoResponsewith fields Jellyfin clients expect, serialized under Jellyfin JSON names. Adds a newclientCapabilitiesResponsetype in handlers_auth.go.sessionInfonow takes the request. It builds a stable session ID from the pseudo-user ID plusDeviceId(or login-session ID), populates client/device/version values from the authorization header, and fills play state and capabilities with defaults.userDTOsetsLastLoginDatefrom session creation time,LastActivityDateto now, andEnableAutoLoginto false. Policy slice fields serialize as empty arrays instead of being omitted.sessionInfodrops hyphens from session IDs and generates a random UUID when no device ID or login-session ID is available.Macroscope summarized a825f9e.