diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 4f866bc4ea..0cb6808b70 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -173,7 +173,7 @@ jsoup = "org.jsoup:jsoup:1.21.1" appyx_core = { module = "com.bumble.appyx:core", version.ref = "appyx" } molecule-runtime = "app.cash.molecule:molecule-runtime:2.1.0" timber = "com.jakewharton.timber:timber:5.0.1" -matrix_sdk = "org.matrix.rustcomponents:sdk-android:25.7.7" +matrix_sdk = "org.matrix.rustcomponents:sdk-android:25.7.10" matrix_richtexteditor = { module = "io.element.android:wysiwyg", version.ref = "wysiwyg" } matrix_richtexteditor_compose = { module = "io.element.android:wysiwyg-compose", version.ref = "wysiwyg" } sqldelight-driver-android = { module = "app.cash.sqldelight:android-driver", version.ref = "sqldelight" } diff --git a/libraries/featureflag/api/src/main/kotlin/io/element/android/libraries/featureflag/api/FeatureFlags.kt b/libraries/featureflag/api/src/main/kotlin/io/element/android/libraries/featureflag/api/FeatureFlags.kt index 81c33318c1..e74304b735 100644 --- a/libraries/featureflag/api/src/main/kotlin/io/element/android/libraries/featureflag/api/FeatureFlags.kt +++ b/libraries/featureflag/api/src/main/kotlin/io/element/android/libraries/featureflag/api/FeatureFlags.kt @@ -175,4 +175,13 @@ enum class FeatureFlags( // False so it's displayed in the developer options screen isFinished = false, ), + SharePos( + key = "feature.share_pos", + title = "Share pos in sliding sync", + description = "Keep the sliding sync pos to make initial syncs faster. Requires an app restart to take effect." + + "\n\nWARNING: this may cause issues with syncs.", + defaultValue = { false }, + // False so it's displayed in the developer options screen + isFinished = false, + ), } diff --git a/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/RustMatrixClientFactory.kt b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/RustMatrixClientFactory.kt index c1dab6f404..6086da5d5b 100644 --- a/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/RustMatrixClientFactory.kt +++ b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/RustMatrixClientFactory.kt @@ -78,6 +78,7 @@ class RustMatrixClientFactory @Inject constructor( client.setUtdDelegate(UtdTracker(analyticsService)) val syncService = client.syncService() + .withSharePos(enable = featureFlagService.isFeatureEnabled(FeatureFlags.SharePos)) .withOfflineMode() .finish() diff --git a/libraries/matrix/impl/src/test/kotlin/io/element/android/libraries/matrix/impl/fixtures/fakes/FakeFfiSyncServiceBuilder.kt b/libraries/matrix/impl/src/test/kotlin/io/element/android/libraries/matrix/impl/fixtures/fakes/FakeFfiSyncServiceBuilder.kt index 93dab14a0c..f423d0295b 100644 --- a/libraries/matrix/impl/src/test/kotlin/io/element/android/libraries/matrix/impl/fixtures/fakes/FakeFfiSyncServiceBuilder.kt +++ b/libraries/matrix/impl/src/test/kotlin/io/element/android/libraries/matrix/impl/fixtures/fakes/FakeFfiSyncServiceBuilder.kt @@ -13,5 +13,6 @@ import org.matrix.rustcomponents.sdk.SyncServiceBuilder class FakeFfiSyncServiceBuilder : SyncServiceBuilder(NoPointer) { override fun withOfflineMode(): SyncServiceBuilder = this + override fun withSharePos(enable: Boolean): SyncServiceBuilder = this override suspend fun finish(): SyncService = FakeFfiSyncService() }