-
Notifications
You must be signed in to change notification settings - Fork 305
Open
Description
Bug Description
ChannelMediaAttachmentsScreen crashes intermittently with duplicate item.id values in LazyGrid causing key collisions.
Error
java.lang.IllegalArgumentException: Key "-1891661558-Loading" was already used.
If you are using LazyColumn/Row please make sure you provide a unique key for each item.
Environment
- stream-chat-android-compose:
6.28.0 - stream-chat-android:
6.28.0 - Android OS: 15 (API 35)
- Architecture: arm64-v8a
Reproduction
StreamChatTheme {
val mediaViewModelFactory = remember {
ChannelAttachmentsViewModelFactory(
cid = navTarget.cid,
attachmentTypes = listOf(AttachmentType.IMAGE, AttachmentType.VIDEO),
)
}
ChannelMediaAttachmentsScreen(
modifier = Modifier
.fillMaxSize()
.statusBarsPadding(),
viewModelFactory = mediaViewModelFactory,
onNavigationIconClick = { performUpNavigation() }
)
}Steps
- Navigate to
ChannelMediaAttachmentsScreenwith multiple media attachments - Crash occurs intermittently when multiple items have duplicate IDs
Stack Trace
java.lang.IllegalArgumentException: Key "-1891661558-Loading" was already used.
at androidx.compose.foundation.lazy.grid.LazyGridKt$rememberLazyGridMeasurePolicy$1$1.invoke-0kLqBqw (SourceFile:837)
at androidx.compose.foundation.lazy.layout.LazyLayoutKt$LazyLayout$1$2$1.invoke-0kLqBqw (SourceFile:14)
Additional Info
- Crash ID:
35a4ed7c-e6aa-4417-a588-61061b090979 - Session ID:
0834bdd0-1607-4749-9932-fb990116c5b9 - Timestamp: 2025-12-04 11:34:31 UTC
- Not consistently reproducible
Metadata
Metadata
Assignees
Labels
No labels