mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 03:06:14 +00:00
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:
+1
@@ -17,4 +17,5 @@ data class SdkStoreSizes(
|
||||
val eventCacheStore: ByteSize?,
|
||||
val mediaStore: ByteSize?,
|
||||
val cryptoStore: ByteSize?,
|
||||
val searchIndex: ByteSize?,
|
||||
)
|
||||
|
||||
+1
@@ -737,6 +737,7 @@ class RustMatrixClient(
|
||||
eventCacheStore = eventCacheStore?.bytes,
|
||||
mediaStore = mediaStore?.bytes,
|
||||
cryptoStore = cryptoStore?.bytes,
|
||||
searchIndex = searchIndex?.bytes,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
+3
@@ -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,
|
||||
))
|
||||
}
|
||||
|
||||
|
||||
+10
-1
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user