Raise the account provider history cap to 20 entries

This commit is contained in:
Jenna Vassar
2026-08-10 09:42:44 -07:00
parent bbb3a68087
commit 749c96e409
2 changed files with 4 additions and 4 deletions
@@ -47,7 +47,7 @@ private val callRingtoneDisplayNameKey = stringPreferencesKey("notificationCallR
// URLs never contain a newline, so it is a safe delimiter to persist an ordered list in a single String.
private const val HOMESERVER_HISTORY_DELIMITER = "\n"
private const val MAX_HOMESERVER_HISTORY_SIZE = 10
private const val MAX_HOMESERVER_HISTORY_SIZE = 20
@ContributesBinding(AppScope::class)
class DefaultAppPreferencesStore(
@@ -110,13 +110,13 @@ class DefaultAppPreferencesStoreTest {
fun `homeserver history is capped to the most recent entries`() = runTest {
val store = createStore()
repeat(15) { index ->
repeat(25) { index ->
store.addHomeserverToHistory("https://server$index.org")
}
val history = store.getHomeserverHistoryFlow().first()
assertThat(history).hasSize(10)
assertThat(history.first()).isEqualTo("https://server14.org")
assertThat(history).hasSize(20)
assertThat(history.first()).isEqualTo("https://server24.org")
assertThat(history.last()).isEqualTo("https://server5.org")
}