|
Fix auth race condition causing frequent logouts
Add per-session-id asyncio.Lock around token refresh to prevent parallel requests from simultaneously refreshing the same token. Re-read the session inside the lock so a second request can use the token already refreshed by the first one. Stop deleting the auth session on refresh failure — transient errors (network, race condition, expired refresh token) were wiping the session and forcing a full re-login. + tests for both behaviours. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> |
|---|
|
|
| navi/auth/deps.py |
|---|
| tests/unit/auth/test_deps.py |
|---|