web: fix SiteDataPage lazy-key collision between storage and permissions
- Commit
3197a62f2f592c42fd14fd03d61d05f891de6dfb- Author
- Vayun Mathur <[email protected]>
- When
- 2026-11-07 03:55 UTC (29 days ago)
- Parents
13856fa
StorageInfo and SitePermission rows live in one LazyColumn but both used their Room id as the item key. The first storage row and the first permission row both have id 1, so opening Site data with both present threw 'Key 1 was already used' and crashed the page. Prefix the keys (storage-/perm-), matching the bm-/h- prefixing already used for the combined bookmark/history list in the omnibox. Found by a new page test that seeds one row of each and renders the page. (This commit contains only the PermissionSheets.kt fix; the staged test and testability changes follow in their own commits.) (cherry picked from commit 8d7385dc13b159c61bdf93bf19280874cfb8894e)
Diff
web/src/main/java/com/vayunmathur/web/ui/PermissionSheets.kt
diff --git a/web/src/main/java/com/vayunmathur/web/ui/PermissionSheets.kt b/web/src/main/java/com/vayunmathur/web/ui/PermissionSheets.ktindex 996d54f38f..911a67ccbe 100644--- a/web/src/main/java/com/vayunmathur/web/ui/PermissionSheets.kt+++ b/web/src/main/java/com/vayunmathur/web/ui/PermissionSheets.kt@@ -186,7 +186,7 @@ internal fun SiteDataPage( if (storages.isNotEmpty()) { item { Text(stringResource(R.string.storage), style = MaterialTheme.typography.titleMedium) }- items(storages, key = { it.id }) { info ->+ items(storages, key = { "storage-${it.id}" }) { info -> StorageInfoCard(info, viewModel) } }@@ -196,7 +196,7 @@ internal fun SiteDataPage( Spacer(Modifier.height(8.dp)) Text(stringResource(R.string.permissions), style = MaterialTheme.typography.titleMedium) }- items(permissions, key = { it.id }) { perm ->+ items(permissions, key = { "perm-${it.id}" }) { perm -> PermissionInfoCard(perm, viewModel) } }