fix(deps): update dependency org.matrix.rustcomponents:sdk-android to v25.3.24 (#4394)
* fix(deps): update dependency org.matrix.rustcomponents:sdk-android to v25.3.24
* Fix SDK changes related to:
- OIDC authentication.
- Element Call widget URL generation.
- Forced trace logging in the SDK.
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jorge Martín <jorgem@element.io>
This commit is contained in:
parent
5f3cf874e2
commit
3597774dd2
14 changed files with 76 additions and 31 deletions
|
|
@ -477,11 +477,16 @@ class RustMatrixClient(
|
|||
override fun roomDirectoryService(): RoomDirectoryService = roomDirectoryService
|
||||
|
||||
override fun close() {
|
||||
innerNotificationClient.close()
|
||||
|
||||
appCoroutineScope.launch {
|
||||
roomFactory.destroy()
|
||||
rustSyncService.destroy()
|
||||
notificationSettingsService.destroy()
|
||||
// This is sync, but it can destroy the `Client` instance and block stopping the sync service
|
||||
notificationProcessSetup.destroy()
|
||||
}
|
||||
|
||||
sessionCoroutineScope.cancel()
|
||||
clientDelegateTaskHandle?.cancelAndDestroy()
|
||||
verificationService.destroy()
|
||||
|
|
@ -489,7 +494,6 @@ class RustMatrixClient(
|
|||
sessionDelegate.clearCurrentClient()
|
||||
innerRoomListService.close()
|
||||
notificationService.close()
|
||||
notificationProcessSetup.destroy()
|
||||
encryptionService.close()
|
||||
innerClient.close()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -205,7 +205,9 @@ class RustMatrixAuthenticationService @Inject constructor(
|
|||
override suspend fun cancelOidcLogin(): Result<Unit> {
|
||||
return withContext(coroutineDispatchers.io) {
|
||||
runCatching {
|
||||
pendingOAuthAuthorizationData?.close()
|
||||
pendingOAuthAuthorizationData?.use {
|
||||
currentClient?.abortOidcAuth(it)
|
||||
}
|
||||
pendingOAuthAuthorizationData = null
|
||||
}.mapFailure { failure ->
|
||||
failure.mapAuthenticationException()
|
||||
|
|
@ -221,16 +223,18 @@ class RustMatrixAuthenticationService @Inject constructor(
|
|||
runCatching {
|
||||
val client = currentClient ?: error("You need to call `setHomeserver()` first")
|
||||
val currentSessionPaths = sessionPaths ?: error("You need to call `setHomeserver()` first")
|
||||
val urlForOidcLogin = pendingOAuthAuthorizationData ?: error("You need to call `getOidcUrl()` first")
|
||||
client.loginWithOidcCallback(urlForOidcLogin, callbackUrl)
|
||||
client.loginWithOidcCallback(callbackUrl)
|
||||
val sessionData = client.session().toSessionData(
|
||||
isTokenValid = true,
|
||||
loginType = LoginType.OIDC,
|
||||
passphrase = pendingPassphrase,
|
||||
sessionPaths = currentSessionPaths,
|
||||
)
|
||||
|
||||
// Free the pending data since we won't use it to abort the flow anymore
|
||||
pendingOAuthAuthorizationData?.close()
|
||||
pendingOAuthAuthorizationData = null
|
||||
|
||||
newMatrixClientObserver?.invoke(rustMatrixClientFactory.create(client))
|
||||
sessionStore.storeData(sessionData)
|
||||
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ class RustSyncService(
|
|||
stopSync()
|
||||
Timber.d("Destroying sync service")
|
||||
isServiceReady.set(false)
|
||||
inner.destroy()
|
||||
}
|
||||
|
||||
override val syncState: StateFlow<SyncState> =
|
||||
|
|
|
|||
|
|
@ -51,5 +51,7 @@ fun TracingConfiguration.map(): org.matrix.rustcomponents.sdk.TracingConfigurati
|
|||
writeToStdoutOrSystem = writesToLogcat,
|
||||
logLevel = logLevel.toRustLogLevel(),
|
||||
extraTargets = extraTargets,
|
||||
// WARNING: this should be used only to debug issues, changes to this value should *never* be published
|
||||
traceLogPacks = emptyList(),
|
||||
writeToFiles = writesToFilesConfiguration.toTracingFileConfiguration(),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -8,30 +8,50 @@
|
|||
package io.element.android.libraries.matrix.impl.widget
|
||||
|
||||
import com.squareup.anvil.annotations.ContributesBinding
|
||||
import io.element.android.appconfig.RageshakeConfig
|
||||
import io.element.android.libraries.core.meta.BuildMeta
|
||||
import io.element.android.libraries.core.meta.BuildType
|
||||
import io.element.android.libraries.di.AppScope
|
||||
import io.element.android.libraries.matrix.api.widget.CallWidgetSettingsProvider
|
||||
import io.element.android.libraries.matrix.api.widget.MatrixWidgetSettings
|
||||
import io.element.android.services.analytics.api.store.AnalyticsStore
|
||||
import io.element.android.services.analyticsproviders.posthog.PosthogEndpointConfigProvider
|
||||
import io.element.android.services.analyticsproviders.sentry.SentryConfig
|
||||
import kotlinx.coroutines.flow.first
|
||||
import org.matrix.rustcomponents.sdk.EncryptionSystem
|
||||
import org.matrix.rustcomponents.sdk.VirtualElementCallWidgetOptions
|
||||
import org.matrix.rustcomponents.sdk.newVirtualElementCallWidget
|
||||
import javax.inject.Inject
|
||||
import org.matrix.rustcomponents.sdk.Intent as CallIntent
|
||||
|
||||
@ContributesBinding(AppScope::class)
|
||||
class DefaultCallWidgetSettingsProvider @Inject constructor() : CallWidgetSettingsProvider {
|
||||
override fun provide(baseUrl: String, widgetId: String, encrypted: Boolean): MatrixWidgetSettings {
|
||||
class DefaultCallWidgetSettingsProvider @Inject constructor(
|
||||
private val buildMeta: BuildMeta,
|
||||
private val posthogEndpointConfigProvider: PosthogEndpointConfigProvider,
|
||||
private val analyticsStore: AnalyticsStore,
|
||||
) : CallWidgetSettingsProvider {
|
||||
override suspend fun provide(baseUrl: String, widgetId: String, encrypted: Boolean): MatrixWidgetSettings {
|
||||
val analyticsEnabled = analyticsStore.userConsentFlow.first()
|
||||
val posthogEndpointConfig = posthogEndpointConfigProvider.provide()
|
||||
val options = VirtualElementCallWidgetOptions(
|
||||
elementCallUrl = baseUrl,
|
||||
widgetId = widgetId,
|
||||
parentUrl = null,
|
||||
hideHeader = null,
|
||||
preload = null,
|
||||
fontScale = null,
|
||||
appPrompt = false,
|
||||
skipLobby = true,
|
||||
confineToRoom = true,
|
||||
font = null,
|
||||
analyticsId = null,
|
||||
encryption = if (encrypted) EncryptionSystem.PerParticipantKeys else EncryptionSystem.Unencrypted,
|
||||
intent = CallIntent.START_CALL,
|
||||
hideScreensharing = false,
|
||||
posthogUserId = null,
|
||||
posthogApiHost = posthogEndpointConfig.host.takeIf { analyticsEnabled },
|
||||
posthogApiKey = posthogEndpointConfig.apiKey.takeIf { analyticsEnabled },
|
||||
rageshakeSubmitUrl = RageshakeConfig.BUG_REPORT_URL,
|
||||
sentryDsn = SentryConfig.DSN.takeIf { analyticsEnabled },
|
||||
sentryEnvironment = if (buildMeta.buildType == BuildType.RELEASE) SentryConfig.ENV_RELEASE else SentryConfig.ENV_DEBUG,
|
||||
parentUrl = null,
|
||||
hideHeader = true,
|
||||
)
|
||||
val rustWidgetSettings = newVirtualElementCallWidget(options)
|
||||
return MatrixWidgetSettings.fromRustWidgetSettings(rustWidgetSettings)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue