[Bug] Auth | Intermittent authentication failure after timer stops and session expires
Problem:
Users experience an intermittent authentication bug where they are unexpectedly logged out while tracking time, and the first login attempt fails before succeeding on the second try.
Steps to reproduce:
- Start tracking time with the timer
- Continue tracking for an extended period
- At some point, the timer stops unexpectedly and the user is disconnected
- Attempt to log in with valid credentials
- First attempt: Login appears successful briefly, then the app disconnects the user
- Second attempt: Login succeeds and time tracking works normally
Expected behavior:
- Timer should not stop unexpectedly
- User should remain authenticated during active sessions
- Login should succeed on the first attempt with valid credentials
Actual behavior:
- Timer stops and user is logged out unexpectedly
- First login attempt fails (authenticates then immediately disconnects)
- Second login attempt succeeds
Additional context:
- This bug is difficult to reproduce consistently
- Likely related to token refresh, session management, or race condition during re-authentication
- May involve expired tokens not being handled correctly on first login attempt
Possible investigation areas:
- Token expiration/refresh logic
- Session timeout handling while timer is active
- Race condition between authentication state and app initialization
- Cookie/storage persistence issues
Environment:
- App: Gauzy Desktop Timer
- Reproducibility: Intermittent
[Bug] Auth | Intermittent authentication failure after timer stops and session expires
Problem:
Users experience an intermittent authentication bug where they are unexpectedly logged out while tracking time, and the first login attempt fails before succeeding on the second try.
Steps to reproduce:
Expected behavior:
Actual behavior:
Additional context:
Possible investigation areas:
Environment: