fix(chats): dedupe public channels in known list by channel id

ChatroomListKnownFeedFilter.feed() iterated account.publicChatList.flow,
a Set<ChannelTag>. ChannelTag uses identity equality (it's not a data
class) and the set is built from raw tag parsing, so a channel list
that names the same channel id twice (e.g., the same channel appearing
in the public section and the encrypted private section, or repeated
with different relay hints) produces multiple ChannelTag entries for
the same channel. Each one resolved to the same newest Note via
getOrCreatePublicChatChannel(it.eventId), so the feed contained the
same Note twice and the chat list LazyColumn crashed with "Key
PublicChannelLazyKey(channelId=...) was already used".

Use the sibling flowSet (Set<HexKey>, already deduped by event id),
which is the same source filterRelevantPublicMessages reads from.
This commit is contained in:
Claude
2026-05-16 12:28:30 +00:00
parent f965d3b331
commit 1c4ddfb2ce
@@ -55,10 +55,10 @@ class ChatroomListKnownFeedFilter(
val publicChannels =
account
.publicChatList.flow.value
.mapNotNull { it ->
.publicChatList.flowSet.value
.mapNotNull { channelId ->
LocalCache
.getOrCreatePublicChatChannel(it.eventId)
.getOrCreatePublicChatChannel(channelId)
.notes
.filter { _, it -> account.isAcceptable(it) && it.event != null }
.sortedWith(DefaultFeedOrder)