AuthUserChangedException

open class AuthUserChangedException : DataConnectException


Thrown when a realtime streaming connection fails because the Firebase Auth user changed.

The SDK will throw this exception if the active Firebase Auth user is changed, either by a new user logging in or a logged-in user logging out while a realtime subscription flow is active.

To automatically reconnect under the new auth credentials, the retryWhen operator can be used:

import kotlinx.coroutines.flow.retryWhen

querySubscription

.flow
.retryWhen { cause, _ -> cause is AuthUserChangedException }
.collect { println(it) }

Summary

Public constructors

Inherited properties

From kotlin.Throwable

Public constructors

AuthUserChangedException

AuthUserChangedException(message: String, cause: Throwable? = null)