QuickConnect authorize writes the token and the request flag in two unguarded round trips #35
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). Follow-up from #18 / PR #34. Tracking: #12.Problem
QuickConnectManager.cs:167-168callsSetAuthorizationAsyncthenSetRequestAsyncas two separate round trips. A valkey failure between them leaves a minted access token in valkey and a device row in PostgreSQL that the poll leg never reveals —Authenticatedstays false for the full TTL — and the never-released claim makes the request unauthorizable on retry.Same defect class that
SetRequestScriptwas introduced to remove for the two-key request write. Narrow window, bounded blast radius, but it leaks a live credential the user can never reach.Proposal
Write the authorization and the
Authenticatedflag in one atomic step, following the existing Lua pattern (SetRequestScript,ClaimAuthorizationScript). Preserve the current client-visible ordering:Authenticated: truemust only become observable once the token exists, so a client polling mid-authorize cannot see authenticated and then 404 on exchange.Acceptance
PostgreSqlTestServerandRedisTestServerintests/Jellyfin.Server.Testsand run in thepostgres-migration-chainWoodpecker step. In-memory providers have hidden different semantics and are how three bugs reached production.