Update Matrix Rust SDK to 26.10.14-nightly (#7930)

* Update Matrix Rust SDK to 26.10.14-nightly

* `withSearchIndexStore` now uses `key` instead of passphrase

* Fix `RustMatrixClient` now returning `searchIndex` size too

---------

Co-authored-by: Jorge Martín <jorgem@element.io>
This commit is contained in:
ElementBot
2026-10-15 15:47:56 +01:00
committed by GitHub
parent 287001f9aa
commit 4ebcf960ce
9 changed files with 45 additions and 9 deletions
@@ -71,7 +71,13 @@ class DeveloperSettingsPresenterTest {
val presenter = createDeveloperSettingsPresenter(
databaseSizesUseCase = GetDatabaseSizesUseCase {
Result.success(
SdkStoreSizes(stateStore = 10.megaBytes, eventCacheStore = 10.megaBytes, mediaStore = 10.megaBytes, cryptoStore = 10.megaBytes)
SdkStoreSizes(
stateStore = 10.megaBytes,
eventCacheStore = 10.megaBytes,
mediaStore = 10.megaBytes,
cryptoStore = 10.megaBytes,
searchIndex = 10.megaBytes,
)
)
}
)
@@ -295,7 +301,7 @@ class DeveloperSettingsPresenterTest {
clearCacheUseCase: FakeClearCacheUseCase = FakeClearCacheUseCase(),
enterpriseService: EnterpriseService = FakeEnterpriseService(),
vacuumStoresUseCase: VacuumStoresUseCase = VacuumStoresUseCase {},
databaseSizesUseCase: GetDatabaseSizesUseCase = GetDatabaseSizesUseCase { Result.success(SdkStoreSizes(null, null, null, null)) },
databaseSizesUseCase: GetDatabaseSizesUseCase = GetDatabaseSizesUseCase { Result.success(SdkStoreSizes(null, null, null, null, null)) },
markAllRoomsAsRead: FakeMarkAllRoomsAsRead = FakeMarkAllRoomsAsRead(),
buildMeta: BuildMeta = aBuildMeta(),
notificationSettingsService: NotificationSettingsService = FakeNotificationSettingsService(),
+1 -1
View File
@@ -186,7 +186,7 @@ test_detekt_test = { module = "io.gitlab.arturbosch.detekt:detekt-test", version
# it as a plain `require`: without this, a library built against a newer SDK would silently drag this app
# onto it. With it, this pin always wins, and a library that needs something newer fails at configuration
# time naming both versions instead of at runtime with NoSuchMethodError.
matrix_sdk = { module = "org.matrix.rustcomponents:sdk-android", version = { strictly = "26.10.12-nightly" } }
matrix_sdk = { module = "org.matrix.rustcomponents:sdk-android", version = { strictly = "26.10.14-nightly" } }
rustls_platform_verifier = "org.rustls:rustls-platform-verifier:0.2.0"
# Others
@@ -17,4 +17,5 @@ data class SdkStoreSizes(
val eventCacheStore: ByteSize?,
val mediaStore: ByteSize?,
val cryptoStore: ByteSize?,
val searchIndex: ByteSize?,
)
@@ -737,6 +737,7 @@ class RustMatrixClient(
eventCacheStore = eventCacheStore?.bytes,
mediaStore = mediaStore?.bytes,
cryptoStore = cryptoStore?.bytes,
searchIndex = searchIndex?.bytes,
)
}
}
@@ -188,7 +188,7 @@ class RustMatrixClientFactory(
// use, or left unencrypted for sessions without one, matching those stores.
withSearchIndexStore(
path = File(sessionPaths.fileDirectory, SEARCH_INDEX_DIRECTORY).absolutePath,
password = clientSecret?.formattedAsString(),
key = clientSecret?.formattedAsString(),
)
} else {
this
@@ -44,6 +44,9 @@ class DefaultGetDatabaseSizesUseCase(
cryptoStore = cryptoSize.bytes,
eventCacheStore = eventCacheSize.bytes,
mediaStore = mediaCacheSize.bytes,
// TODO - The search index is not stored in a database file but in a directory, which can be expensive to calculate.
// For now, we return null to avoid performance issues.
searchIndex = null,
))
}
@@ -256,7 +256,15 @@ class RustMatrixClientTest {
@Test
fun `getDatabaseSizes returns the database sizes`() = runTest {
val client = createRustMatrixClient(
client = FakeFfiClient(getStoreSizesResult = { StoreSizes(null, 10uL, 11uL, 12uL) })
client = FakeFfiClient(getStoreSizesResult = {
StoreSizes(
cryptoStore = null,
stateStore = 10uL,
eventCacheStore = 11uL,
mediaStore = 12uL,
searchIndex = 13uL,
)
})
)
client.getDatabaseSizes().getOrThrow().run {
@@ -264,6 +272,7 @@ class RustMatrixClientTest {
assertThat(stateStore).isEqualTo(10.bytes)
assertThat(eventCacheStore).isEqualTo(11.bytes)
assertThat(mediaStore).isEqualTo(12.bytes)
assertThat(searchIndex).isEqualTo(13.bytes)
}
}
@@ -14,6 +14,7 @@ object AnalyticsUserData {
const val EVENT_CACHE_SIZE = "event_cache_size"
const val CRYPTO_STORE_SIZE = "crypto_store_size"
const val MEDIA_STORE_SIZE = "media_store_size"
const val SEARCH_INDEX_SIZE = "search_index_size"
const val FIRST_SYNC_STATE = "first_sync_state"
const val TIMELINE_ITEM_COUNT = "timeline_item_count"
@@ -142,7 +142,13 @@ class SentryAnalyticsProviderTest : RobolectricTest() {
createSentryAnalyticsProvider(
getDatabaseSizesUseCase = GetDatabaseSizesUseCase {
Result.success(
SdkStoreSizes(stateStore = 10.megaBytes, eventCacheStore = 11.megaBytes, mediaStore = 12.megaBytes, cryptoStore = 13.megaBytes)
SdkStoreSizes(
stateStore = 10.megaBytes,
eventCacheStore = 11.megaBytes,
mediaStore = 12.megaBytes,
cryptoStore = 13.megaBytes,
searchIndex = 14.megaBytes,
)
)
},
appNavigationStateService = FakeAppNavigationStateService(
@@ -167,6 +173,9 @@ class SentryAnalyticsProviderTest : RobolectricTest() {
assertThat(result.getExtra(AnalyticsUserData.EVENT_CACHE_SIZE)).isEqualTo(11)
assertThat(result.getExtra(AnalyticsUserData.MEDIA_STORE_SIZE)).isEqualTo(12)
assertThat(result.getExtra(AnalyticsUserData.CRYPTO_STORE_SIZE)).isEqualTo(13)
// The search index size won't be included
assertThat(result.getExtra(AnalyticsUserData.SEARCH_INDEX_SIZE)).isNull()
}
}
@@ -175,7 +184,13 @@ class SentryAnalyticsProviderTest : RobolectricTest() {
createSentryAnalyticsProvider(
getDatabaseSizesUseCase = GetDatabaseSizesUseCase {
Result.success(
SdkStoreSizes(stateStore = 10.megaBytes, eventCacheStore = 11.megaBytes, mediaStore = 12.megaBytes, cryptoStore = 13.megaBytes)
SdkStoreSizes(
stateStore = 10.megaBytes,
eventCacheStore = 11.megaBytes,
mediaStore = 12.megaBytes,
cryptoStore = 13.megaBytes,
searchIndex = 14.megaBytes,
)
)
},
appNavigationStateService = FakeAppNavigationStateService(
@@ -196,7 +211,7 @@ class SentryAnalyticsProviderTest : RobolectricTest() {
createSentryAnalyticsProvider(
getDatabaseSizesUseCase = GetDatabaseSizesUseCase {
Result.success(
SdkStoreSizes(stateStore = null, eventCacheStore = null, mediaStore = null, cryptoStore = null)
SdkStoreSizes(stateStore = null, eventCacheStore = null, mediaStore = null, cryptoStore = null, searchIndex = null)
)
},
appNavigationStateService = FakeAppNavigationStateService(
@@ -216,7 +231,7 @@ class SentryAnalyticsProviderTest : RobolectricTest() {
private fun createSentryAnalyticsProvider(
sentryDsn: SentryDsn? = SentryDsn("https://1234@sentry.com/a"),
buildMeta: BuildMeta = aBuildMeta(),
getDatabaseSizesUseCase: GetDatabaseSizesUseCase = GetDatabaseSizesUseCase { Result.success(SdkStoreSizes(null, null, null, null)) },
getDatabaseSizesUseCase: GetDatabaseSizesUseCase = GetDatabaseSizesUseCase { Result.success(SdkStoreSizes(null, null, null, null, null)) },
appNavigationStateService: FakeAppNavigationStateService = FakeAppNavigationStateService(
initialAppNavigationState = AppNavigationState(NavigationState.Session("owner", A_SESSION_ID), isInForeground = true)
)