diff --git a/library/src/androidTest/java/org/xmtp/android/library/GroupTest.kt b/library/src/androidTest/java/org/xmtp/android/library/GroupTest.kt index cd2262b6f..2c5aa9d74 100644 --- a/library/src/androidTest/java/org/xmtp/android/library/GroupTest.kt +++ b/library/src/androidTest/java/org/xmtp/android/library/GroupTest.kt @@ -773,11 +773,12 @@ class GroupTest { Thread.sleep(2500) caroClient.conversations.newGroup(listOf(alix.walletAddress)) caroClient.conversations.findOrCreateDm(alix.walletAddress) + boClient.conversations.findOrCreateDm(alix.walletAddress) } Thread.sleep(2500) - assertEquals(2, allMessages.size) + assertEquals(3, allMessages.size) job.cancel() } diff --git a/library/src/main/java/org/xmtp/android/library/Conversations.kt b/library/src/main/java/org/xmtp/android/library/Conversations.kt index 00ebb7ba0..6dd9816b9 100644 --- a/library/src/main/java/org/xmtp/android/library/Conversations.kt +++ b/library/src/main/java/org/xmtp/android/library/Conversations.kt @@ -225,6 +225,7 @@ data class Conversations( if (client.v3Client != null) { val dm = findOrCreateDm(peerAddress) val conversation = Conversation.Dm(dm) + if (!client.hasV2Client) conversationsByTopic[conversation.topic] = conversation if (!client.hasV2Client || !client.canMessage(peerAddress)) { return conversation } @@ -436,7 +437,7 @@ data class Conversations( syncConversations() val dms = listDms().map { Conversation.Dm(it) } if (!client.hasV2Client) { - conversationsByTopic += dms.map { it.topic to it } + conversationsByTopic = dms.associate { it.topic to it as Conversation }.toMutableMap() } else { try { conversationsByTopic.putAll(