From e5cb5439ff14d5f2f30095b5fba1acbcf6de6ff3 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 19 Jun 2026 21:01:17 +0000 Subject: [PATCH 1/2] fix: dedupe emoji pack addresses in My Emoji List grid A kind 10030 emoji selection event can carry the same `a` tag more than once. MyEmojiListScreen keys its LazyVerticalGrid items by address.toValue(), so a duplicate address crashed Compose with "Key ... was already used". Deduplicate on the same value used as the grid key before rendering. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_012fxWguG7dXgwwe2Et3JBjR --- .../emojipacks/membershipManagement/MyEmojiListScreen.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/emojipacks/membershipManagement/MyEmojiListScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/emojipacks/membershipManagement/MyEmojiListScreen.kt index 4016e869f3..3bd2e52b71 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/emojipacks/membershipManagement/MyEmojiListScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/emojipacks/membershipManagement/MyEmojiListScreen.kt @@ -104,7 +104,11 @@ private fun MyEmojiListView( selectionNote, accountViewModel, ) { event -> - event?.emojiPacks() ?: emptyList() + // The kind 10030 selection event can carry the same `a` tag more than once (e.g. a pack + // added twice). The grid below keys items by `address.toValue()`, so duplicates would + // throw an IllegalArgumentException ("Key ... was already used"). Dedupe on the same + // value used as the key. + event?.emojiPacks()?.distinctBy { it.toValue() } ?: emptyList() } Column( From ba6b01a71533af253d5a184dcf179f34531ae4b1 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 19 Jun 2026 21:09:18 +0000 Subject: [PATCH 2/2] refactor: dedupe emoji pack addresses with distinct() Address is a data class over (kind, pubKeyHex, dTag), the same fields toValue() encodes, so distinct() dedupes on exactly the grid key without the redundant toValue() projection. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_012fxWguG7dXgwwe2Et3JBjR --- .../emojipacks/membershipManagement/MyEmojiListScreen.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/emojipacks/membershipManagement/MyEmojiListScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/emojipacks/membershipManagement/MyEmojiListScreen.kt index 3bd2e52b71..c9ad83d803 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/emojipacks/membershipManagement/MyEmojiListScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/emojipacks/membershipManagement/MyEmojiListScreen.kt @@ -106,9 +106,10 @@ private fun MyEmojiListView( ) { event -> // The kind 10030 selection event can carry the same `a` tag more than once (e.g. a pack // added twice). The grid below keys items by `address.toValue()`, so duplicates would - // throw an IllegalArgumentException ("Key ... was already used"). Dedupe on the same - // value used as the key. - event?.emojiPacks()?.distinctBy { it.toValue() } ?: emptyList() + // throw an IllegalArgumentException ("Key ... was already used"). Address is a data + // class over (kind, pubKeyHex, dTag) — the same fields toValue() encodes — so distinct() + // dedupes on exactly the grid key. + event?.emojiPacks()?.distinct() ?: emptyList() } Column(