Device capabilities are not persisted #22
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?
Context: multi-replica stateless deployment (two 2-replica apps,
cheeztvandfafflix, each one PostgreSQL plus valkey, no sticky sessions). Not a 12.0 regression — live in the deployed build. Tracking: #12.Problem
Jellyfin.Server.Implementations/Devices/DeviceManager.cskeeps_capabilitiesMapin process, so reported capabilities exist only on the pod the client reported them to.ClientCapabilities.SupportsPersistentIdentifierdefaults totrue(MediaBrowser.Model/Session/ClientCapabilities.cs:17), soCanAccessDevicefails closed: a restricted user's device is wrongly denied on every pod that never saw the report. The user gets an access error on some requests and not others.Separately, missing capabilities make
MediaInfoHelperfall back to a default device profile, producing a worse transcode decision than the client actually needs.Proposal
Persist capabilities to a new table keyed by device id, and read them through on
CanAccessDeviceand inMediaInfoHelper. PR #8 already dropped the device and device-options dictionaries in favour of reading the database per query; this extends the same approach to capabilities.This needs an EF migration. Any PostgreSQL migration here must be append-only — regenerating the provider's baseline previously broke upgrades of existing databases in production.
Acceptance
CanAccessDevicefor a restricted user's device returns true on B;MediaInfoHelperon B uses the reported profile rather than the default.PostgreSqlTestServerintests/Jellyfin.Server.Testsand run in thepostgres-migration-chainWoodpecker step (JELLYFIN_TEST_POSTGRES). In-memory providers have hidden different semantics and are how three bugs reached production.