FACTUAL ACTIVITY RECORD · An activity record based on work that took place
Fixing restoration of expired Auth sessions
Aligning startup refresh, single-flight retry, and Keychain deletion in one lifecycle
Purpose
Control Center treated any Keychain session as signed in without checking expiry, then had its first API request rejected by an expired JWT. Sign-in state needed to return only after a successful refresh.
Implementation
ControlCenterCore/remote control client now implements the Auth session lifecycle. Startup no longer trusts a stored session directly: it refreshes the token, revalidates administrator metadata, and saves the new session to Keychain. A rejected refresh deletes the old session and returns to login.
An API 401 triggers one retry after a single-flight refresh, so concurrent requests do not launch multiple refreshes. Logout deletes the local Keychain session even if the remote token is already invalid. authentication-session lifecycle test adds regression coverage for success, rejection, concurrency, and logout.
Rendering diagram…
What was confirmed
Verification results
Tests confirmed that the administration interface is not entered before refresh success and that rejected sessions are removed from storage.
A 401 retry is limited to one, and concurrent requests share a single refresh.
The 20 Swift and 43 TypeScript tests and repository-wide verification passed. Provider expiry through real elapsed time was not observed within the cutoff.
Basis for completion
Completion required startup, API 401, concurrent requests, and logout to share one lifecycle that never restores an expired session unconditionally.