Skip to content

Session Import Race Condition #300

@annrose2277-glitch

Description

@annrose2277-glitch

Bug Report | Authentication Critical

Description
The checkAuthState() function uses multiple sequential timeouts (line 203, 215, 231) that may not synchronize properly with Supabase SDK initialization. If any timeout expires before session manager is ready, tokens are lost.

Steps to Reproduce
Cold start app on slow device
App initializes auth on background thread
Supabase SDK slow to initialize (>2.5s)
Session import fails; user is logged out
Expected Behavior
Auth should retry or wait for Supabase SDK initialization

Actual Behavior
Session is lost due to timeout; user must re-login

Environment
Platform: Android TV/Mobile
Component: Auth Repository
File: app/src/main/kotlin/com/arflix/tv/data/repository/AuthRepository.kt (line 188-269)
Possible Fix
Implement exponential backoff retry logic or await Supabase SDK readiness signal.

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions