supabase-community / supabase-kt

A Kotlin Multiplatform Client for Supabase.
https://supabase.com/docs/reference/kotlin/introduction
MIT License
421 stars 38 forks source link

Refactor SessionStatus #725

Closed jan-tennert closed 2 months ago

jan-tennert commented 2 months ago

What kind of change does this PR introduce?

Feature and Bug fix (closes #724)

What is the current behavior?

The session gets cleared if the refresh operation fails, no matter the cause/status code. You also cannot get the exception the refresh operation fails with in your code.

What is the new behavior?

SessionStatus has been moved to its own status package. There have been changes to two statuses: LoadingFromStorage -> Initializing NetworkError -> data class RefreshFailure(cause) The cause can be one of two things:

Additional context

Add any other context or screenshots.