compose: SearchScreen: Use random UUID as keys

Server can send same package again as we are filtering through different bundles. Keys are basically
packageName's hashcode, so they can end up as being similar and crash the app.

Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
Aayush Gupta
2026-04-08 16:08:02 +08:00
parent f9ca15eea4
commit a1d15f16bd
2 changed files with 4 additions and 3 deletions

View File

@@ -63,7 +63,6 @@ import androidx.paging.LoadState
import androidx.paging.PagingData
import androidx.paging.compose.LazyPagingItems
import androidx.paging.compose.collectAsLazyPagingItems
import androidx.paging.compose.itemKey
import com.aurora.extensions.emptyPagingItems
import com.aurora.gplayapi.SearchSuggestEntry
import com.aurora.gplayapi.data.models.App
@@ -82,6 +81,7 @@ import kotlinx.coroutines.android.awaitFrame
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.collectLatest
import kotlinx.coroutines.launch
import kotlin.uuid.Uuid
@Composable
fun SearchScreen(onNavigateUp: () -> Unit, viewModel: SearchViewModel = hiltViewModel()) {
@@ -257,7 +257,7 @@ private fun ScreenContent(
LazyColumn {
items(
count = results.itemCount,
key = results.itemKey { it.id }
key = { Uuid.random().toString() }
) { index ->
results[index]?.let { app ->
LargeAppListItem(