mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 06:55:41 +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:
+8
-2
@@ -71,7 +71,13 @@ class DeveloperSettingsPresenterTest {
|
|||||||
val presenter = createDeveloperSettingsPresenter(
|
val presenter = createDeveloperSettingsPresenter(
|
||||||
databaseSizesUseCase = GetDatabaseSizesUseCase {
|
databaseSizesUseCase = GetDatabaseSizesUseCase {
|
||||||
Result.success(
|
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(),
|
clearCacheUseCase: FakeClearCacheUseCase = FakeClearCacheUseCase(),
|
||||||
enterpriseService: EnterpriseService = FakeEnterpriseService(),
|
enterpriseService: EnterpriseService = FakeEnterpriseService(),
|
||||||
vacuumStoresUseCase: VacuumStoresUseCase = VacuumStoresUseCase {},
|
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(),
|
markAllRoomsAsRead: FakeMarkAllRoomsAsRead = FakeMarkAllRoomsAsRead(),
|
||||||
buildMeta: BuildMeta = aBuildMeta(),
|
buildMeta: BuildMeta = aBuildMeta(),
|
||||||
notificationSettingsService: NotificationSettingsService = FakeNotificationSettingsService(),
|
notificationSettingsService: NotificationSettingsService = FakeNotificationSettingsService(),
|
||||||
|
|||||||
@@ -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
|
# 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
|
# 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.
|
# 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"
|
rustls_platform_verifier = "org.rustls:rustls-platform-verifier:0.2.0"
|
||||||
|
|
||||||
# Others
|
# Others
|
||||||
|
|||||||
+1
@@ -17,4 +17,5 @@ data class SdkStoreSizes(
|
|||||||
val eventCacheStore: ByteSize?,
|
val eventCacheStore: ByteSize?,
|
||||||
val mediaStore: ByteSize?,
|
val mediaStore: ByteSize?,
|
||||||
val cryptoStore: ByteSize?,
|
val cryptoStore: ByteSize?,
|
||||||
|
val searchIndex: ByteSize?,
|
||||||
)
|
)
|
||||||
|
|||||||
+1
@@ -737,6 +737,7 @@ class RustMatrixClient(
|
|||||||
eventCacheStore = eventCacheStore?.bytes,
|
eventCacheStore = eventCacheStore?.bytes,
|
||||||
mediaStore = mediaStore?.bytes,
|
mediaStore = mediaStore?.bytes,
|
||||||
cryptoStore = cryptoStore?.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.
|
// use, or left unencrypted for sessions without one, matching those stores.
|
||||||
withSearchIndexStore(
|
withSearchIndexStore(
|
||||||
path = File(sessionPaths.fileDirectory, SEARCH_INDEX_DIRECTORY).absolutePath,
|
path = File(sessionPaths.fileDirectory, SEARCH_INDEX_DIRECTORY).absolutePath,
|
||||||
password = clientSecret?.formattedAsString(),
|
key = clientSecret?.formattedAsString(),
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
this
|
this
|
||||||
|
|||||||
+3
@@ -44,6 +44,9 @@ class DefaultGetDatabaseSizesUseCase(
|
|||||||
cryptoStore = cryptoSize.bytes,
|
cryptoStore = cryptoSize.bytes,
|
||||||
eventCacheStore = eventCacheSize.bytes,
|
eventCacheStore = eventCacheSize.bytes,
|
||||||
mediaStore = mediaCacheSize.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
|
@Test
|
||||||
fun `getDatabaseSizes returns the database sizes`() = runTest {
|
fun `getDatabaseSizes returns the database sizes`() = runTest {
|
||||||
val client = createRustMatrixClient(
|
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 {
|
client.getDatabaseSizes().getOrThrow().run {
|
||||||
@@ -264,6 +272,7 @@ class RustMatrixClientTest {
|
|||||||
assertThat(stateStore).isEqualTo(10.bytes)
|
assertThat(stateStore).isEqualTo(10.bytes)
|
||||||
assertThat(eventCacheStore).isEqualTo(11.bytes)
|
assertThat(eventCacheStore).isEqualTo(11.bytes)
|
||||||
assertThat(mediaStore).isEqualTo(12.bytes)
|
assertThat(mediaStore).isEqualTo(12.bytes)
|
||||||
|
assertThat(searchIndex).isEqualTo(13.bytes)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
@@ -14,6 +14,7 @@ object AnalyticsUserData {
|
|||||||
const val EVENT_CACHE_SIZE = "event_cache_size"
|
const val EVENT_CACHE_SIZE = "event_cache_size"
|
||||||
const val CRYPTO_STORE_SIZE = "crypto_store_size"
|
const val CRYPTO_STORE_SIZE = "crypto_store_size"
|
||||||
const val MEDIA_STORE_SIZE = "media_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 FIRST_SYNC_STATE = "first_sync_state"
|
||||||
const val TIMELINE_ITEM_COUNT = "timeline_item_count"
|
const val TIMELINE_ITEM_COUNT = "timeline_item_count"
|
||||||
|
|||||||
+19
-4
@@ -142,7 +142,13 @@ class SentryAnalyticsProviderTest : RobolectricTest() {
|
|||||||
createSentryAnalyticsProvider(
|
createSentryAnalyticsProvider(
|
||||||
getDatabaseSizesUseCase = GetDatabaseSizesUseCase {
|
getDatabaseSizesUseCase = GetDatabaseSizesUseCase {
|
||||||
Result.success(
|
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(
|
appNavigationStateService = FakeAppNavigationStateService(
|
||||||
@@ -167,6 +173,9 @@ class SentryAnalyticsProviderTest : RobolectricTest() {
|
|||||||
assertThat(result.getExtra(AnalyticsUserData.EVENT_CACHE_SIZE)).isEqualTo(11)
|
assertThat(result.getExtra(AnalyticsUserData.EVENT_CACHE_SIZE)).isEqualTo(11)
|
||||||
assertThat(result.getExtra(AnalyticsUserData.MEDIA_STORE_SIZE)).isEqualTo(12)
|
assertThat(result.getExtra(AnalyticsUserData.MEDIA_STORE_SIZE)).isEqualTo(12)
|
||||||
assertThat(result.getExtra(AnalyticsUserData.CRYPTO_STORE_SIZE)).isEqualTo(13)
|
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(
|
createSentryAnalyticsProvider(
|
||||||
getDatabaseSizesUseCase = GetDatabaseSizesUseCase {
|
getDatabaseSizesUseCase = GetDatabaseSizesUseCase {
|
||||||
Result.success(
|
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(
|
appNavigationStateService = FakeAppNavigationStateService(
|
||||||
@@ -196,7 +211,7 @@ class SentryAnalyticsProviderTest : RobolectricTest() {
|
|||||||
createSentryAnalyticsProvider(
|
createSentryAnalyticsProvider(
|
||||||
getDatabaseSizesUseCase = GetDatabaseSizesUseCase {
|
getDatabaseSizesUseCase = GetDatabaseSizesUseCase {
|
||||||
Result.success(
|
Result.success(
|
||||||
SdkStoreSizes(stateStore = null, eventCacheStore = null, mediaStore = null, cryptoStore = null)
|
SdkStoreSizes(stateStore = null, eventCacheStore = null, mediaStore = null, cryptoStore = null, searchIndex = null)
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
appNavigationStateService = FakeAppNavigationStateService(
|
appNavigationStateService = FakeAppNavigationStateService(
|
||||||
@@ -216,7 +231,7 @@ class SentryAnalyticsProviderTest : RobolectricTest() {
|
|||||||
private fun createSentryAnalyticsProvider(
|
private fun createSentryAnalyticsProvider(
|
||||||
sentryDsn: SentryDsn? = SentryDsn("https://1234@sentry.com/a"),
|
sentryDsn: SentryDsn? = SentryDsn("https://1234@sentry.com/a"),
|
||||||
buildMeta: BuildMeta = aBuildMeta(),
|
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(
|
appNavigationStateService: FakeAppNavigationStateService = FakeAppNavigationStateService(
|
||||||
initialAppNavigationState = AppNavigationState(NavigationState.Session("owner", A_SESSION_ID), isInForeground = true)
|
initialAppNavigationState = AppNavigationState(NavigationState.Session("owner", A_SESSION_ID), isInForeground = true)
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user