SDK Parity: Kotlin implementation needed
Reference Implementation (supabase-js)
- Commit:
54ec2b6
- PR: #2392
- Module: auth
- Type: new-feature + deprecation
What Changed
-
New dispose() method on auth client — explicitly stops auto-refresh and cleans up state. Prevents coroutine leaks when the client is no longer needed.
-
New AuthRefreshDiscardedError — returned when a token refresh succeeded server-side but tokens were discarded because the local session changed mid-flight (e.g., concurrent signOut).
-
lock option deprecated — navigator.locks-based mutex removed.
Code Reference
async dispose(): Promise<void> // stops auto-refresh, clears state
class AuthRefreshDiscardedError extends AuthError {
name = 'AuthRefreshDiscardedError'
// session changed mid-flight during refresh
}
Implementation Guidance (Kotlin)
// New method on GoTrueClient
fun dispose() {
// Cancel auto-refresh coroutine/Job
// Clear in-memory session state
}
// New exception
class AuthRefreshDiscardedException(message: String = "Session refresh was discarded")
: RestException(message, ...)
Key Behaviors
dispose() cancels background refresh jobs (idempotent)
AuthRefreshDiscardedException used when refresh succeeded but session changed mid-flight
- Deprecate
lock option if present
Acceptance Criteria
Context
Generated with Claude Code /sync-sdk-parity
SDK Parity: Kotlin implementation needed
Reference Implementation (supabase-js)
54ec2b6What Changed
New
dispose()method on auth client — explicitly stops auto-refresh and cleans up state. Prevents coroutine leaks when the client is no longer needed.New
AuthRefreshDiscardedError— returned when a token refresh succeeded server-side but tokens were discarded because the local session changed mid-flight (e.g., concurrentsignOut).lockoption deprecated — navigator.locks-based mutex removed.Code Reference
Implementation Guidance (Kotlin)
Key Behaviors
dispose()cancels background refresh jobs (idempotent)AuthRefreshDiscardedExceptionused when refresh succeeded but session changed mid-flightlockoption if presentAcceptance Criteria
dispose()method added, cancels background refreshAuthRefreshDiscardedExceptionaddedContext
Generated with Claude Code
/sync-sdk-parity