android: l'app restava bloccata sullo splash con un refresh token scaduto #5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/refresh-deadlock"
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?
Il bug
Con un refresh token non più valido (scaduto, o
jwt_secretdel bridge cambiato) l'app restava per sempre su "Pronto." invece di andare al login./auth/me→ 401 → ilrefreshInterceptorchiama/auth/refresh, che passa dallo stesso interceptor: 401 → nuovo refresh → … Ogni livello blocca un thread OkHttp inrunBlockingsul successivo; dopo 5 richieste allo stesso host (limite del dispatcher) la sesta resta in coda per sempre. Nel logcat: 1me+ 4refresh, poi silenzio.Il fix
Un 401 su
/auth/refreshviene restituito così com'è: il chiamante cancella i token,/metorna 401 e lo splash porta al login.Verifica
Sull'emulatore con il vecchio token:
me 401 → refresh 401 → me 401→ schermata di login.🤖 Generated with Claude Code
With a dead refresh token (expired, or a new jwt_secret on the bridge) the /auth/refresh call went through the same refreshInterceptor, got a 401 and tried to refresh again. Each level blocked an OkHttp thread in runBlocking on the next one; after five requests to the same host the dispatcher queued the sixth forever and the app hung on the splash ("Pronto.") instead of falling back to the login screen. Return a 401 from /auth/refresh untouched: the caller clears the tokens and the splash routes to login. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>