From 306d76f793de9cfa65b035a59cbbfa313684c9fd Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Mon, 23 Mar 2026 13:47:00 -0400 Subject: [PATCH] Tries to fix IllegalArgumentException: 1.06.0-PLAY | Prop | Value | |------|-------| | Manuf |Google | | Model |Pixel 8a | | Prod |akita | | Android |16 | | SDK Int |36 | | Brand |google | | Hardware |akita | | Device | akita | | Host | r-0123456789abcdef-0123 | | User | android-user | ``` java.lang.IllegalArgumentException: Cannot disable reuse from root if it was caused by other groups androidx.compose.runtime.PreconditionsKt.throwIllegalArgumentException(r8-map-id-eb237b6d0af50dd04fa25285a72672c5149c195876ad0d708b61d757d31f3d90:3) androidx.compose.runtime.ComposerImpl.endReuseFromRoot(r8-map-id-eb237b6d0af50dd04fa25285a72672c5149c195876ad0d708b61d757d31f3d90:19) androidx.compose.runtime.PausedCompositionImpl.resume(r8-map-id-eb237b6d0af50dd04fa25285a72672c5149c195876ad0d708b61d757d31f3d90:369) androidx.compose.ui.layout.LayoutNodeSubcompositionsState$precomposePaused$2.resume(r8-map-id-eb237b6d0af50dd04fa25285a72672c5149c195876ad0d708b61d757d31f3d90:50) androidx.compose.foundation.lazy.layout.PrefetchHandleProvider$HandleAndRequestImpl.performPausableComposition(r8-map-id-eb237b6d0af50dd04fa25285a72672c5149c195876ad0d708b61d757d31f3d90:49) androidx.compose.foundation.lazy.layout.PrefetchHandleProvider$HandleAndRequestImpl.executeRequest(r8-map-id-eb237b6d0af50dd04fa25285a72672c5149c195876ad0d708b61d757d31f3d90:128) androidx.compose.foundation.lazy.layout.PrefetchHandleProvider$HandleAndRequestImpl.execute(r8-map-id-eb237b6d0af50dd04fa25285a72672c5149c195876ad0d708b61d757d31f3d90:33) androidx.compose.foundation.lazy.layout.AndroidPrefetchScheduler.runRequest(r8-map-id-eb237b6d0af50dd04fa25285a72672c5149c195876ad0d708b61d757d31f3d90:36) androidx.compose.foundation.lazy.layout.AndroidPrefetchScheduler.run(r8-map-id-eb237b6d0af50dd04fa25285a72672c5149c195876ad0d708b61d757d31f3d90:113) android.os.Handler.handleCallback(Handler.java:1070) android.os.Handler.dispatchMessage(Handler.java:125) android.os.Looper.dispatchMessage(Looper.java:333) android.os.Looper.loopOnce(Looper.java:263) android.os.Looper.loop(Looper.java:367) android.app.ActivityThread.main(ActivityThread.java:9331) java.lang.reflect.Method.invoke(Native Method) com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:566) com.android.internal.os.ZygoteInit.main(ZygoteInit.java:837) ``` --- .../java/com/vitorpamplona/amethyst/ui/feeds/FeedLoaded.kt | 6 +++++- .../amethyst/ui/screen/loggedIn/chats/feed/ChatFeedView.kt | 2 +- .../amethyst/ui/screen/loggedIn/home/HomeScreen.kt | 2 +- .../ui/screen/loggedIn/threadview/ThreadFeedView.kt | 6 +++++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/feeds/FeedLoaded.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/feeds/FeedLoaded.kt index 548a56d35..e55d48f38 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/feeds/FeedLoaded.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/feeds/FeedLoaded.kt @@ -53,7 +53,11 @@ fun FeedLoaded( contentPadding = FeedPadding, state = listState, ) { - itemsIndexed(items.list, key = { _, item -> item.idHex }) { _, item -> + itemsIndexed( + items.list, + key = { _, item -> item.idHex }, + contentType = { _, item -> item.event?.kind ?: -1 }, + ) { _, item -> Row(Modifier.fillMaxWidth().animateItem()) { NoteCompose( item, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/feed/ChatFeedView.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/feed/ChatFeedView.kt index 6bceec5d0..7c9846dd1 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/feed/ChatFeedView.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/feed/ChatFeedView.kt @@ -137,7 +137,7 @@ fun ChatFeedLoaded( reverseLayout = true, state = listState, ) { - itemsIndexed(items.list, key = { _, item -> item.idHex }) { index, item -> + itemsIndexed(items.list, key = { _, item -> item.idHex }, contentType = { _, item -> item.event?.kind ?: -1 }) { index, item -> val noteEvent = item.event if (avoidDraft == null || noteEvent !is DraftWrapEvent || noteEvent.dTag() !in avoidDraft.usedDraftTags) { ChatroomMessageCompose( diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/home/HomeScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/home/HomeScreen.kt index feaeb1543..7392c05b3 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/home/HomeScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/home/HomeScreen.kt @@ -313,7 +313,7 @@ fun FeedLoaded( Spacer(StdVertSpacer) } } - itemsIndexed(items.list, key = { _, item -> item.idHex }) { _, item -> + itemsIndexed(items.list, key = { _, item -> item.idHex }, contentType = { _, item -> item.event?.kind ?: -1 }) { _, item -> Row( Modifier .fillMaxWidth() diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/threadview/ThreadFeedView.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/threadview/ThreadFeedView.kt index 0b1212fbf..9dad17e3b 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/threadview/ThreadFeedView.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/threadview/ThreadFeedView.kt @@ -330,7 +330,11 @@ fun RenderThreadFeed( contentPadding = FeedPadding, state = listState, ) { - itemsIndexed(items.list, key = { _, item -> item.idHex }) { index, item -> + itemsIndexed( + items.list, + key = { _, item -> item.idHex }, + contentType = { index, _ -> if (index == 0) "master" else "reply" }, + ) { index, item -> val level = viewModel.levelFlowForItem(item).collectAsStateWithLifecycle(0) val modifier =