Make sure to save the tokens the Client might return when its session is restored (#3378)
* Use `ClientSessionDelegate` to ensure tokens are always updated. Refreshed tokens on client restoration might not have been stored to disk if the token refresh happened before `RustMatrixClient` was built and the `ClientDelegate` was set in it. Using `ClientSessionDelegate` should ensure the tokens refreshed callback is called at any point in time. * Improve how assigning the Client works, fix docs * Fix review comments
This commit is contained in:
parent
9fb82a1e86
commit
2c8b0d0b95
10 changed files with 161 additions and 98 deletions
|
|
@ -122,7 +122,7 @@ class FakeMatrixClient(
|
|||
var getRoomInfoFlowLambda = { _: RoomId ->
|
||||
flowOf<Optional<MatrixRoomInfo>>(Optional.empty())
|
||||
}
|
||||
var logoutLambda: (Boolean) -> String? = {
|
||||
var logoutLambda: (Boolean, Boolean) -> String? = { _, _ ->
|
||||
null
|
||||
}
|
||||
|
||||
|
|
@ -170,8 +170,8 @@ class FakeMatrixClient(
|
|||
clearCacheLambda()
|
||||
}
|
||||
|
||||
override suspend fun logout(ignoreSdkError: Boolean): String? = simulateLongTask {
|
||||
return logoutLambda(ignoreSdkError)
|
||||
override suspend fun logout(userInitiated: Boolean, ignoreSdkError: Boolean): String? = simulateLongTask {
|
||||
return logoutLambda(ignoreSdkError, userInitiated)
|
||||
}
|
||||
|
||||
override fun close() = Unit
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue