Skip to content

Commit dfdc218

Browse files
committed
get group streaming working
1 parent 769c270 commit dfdc218

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

library/src/androidTest/java/org/xmtp/android/library/GroupTest.kt

+7-5
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,11 @@ class GroupTest {
231231
fun testCanStreamGroups() = kotlinx.coroutines.test.runTest {
232232
boClient.conversations.streamGroups().test {
233233
val group =
234-
boClient.conversations.newGroup(listOf(alix.walletAddress))
235-
group.send("hi")
236-
assertEquals("hi", awaitItem().messages().first().body)
234+
alixClient.conversations.newGroup(listOf(bo.walletAddress))
235+
assertEquals(group.id.toHex(), awaitItem().id.toHex())
236+
val group2 =
237+
caroClient.conversations.newGroup(listOf(bo.walletAddress))
238+
assertEquals(group2.id.toHex(), awaitItem().id.toHex())
237239
}
238240
}
239241

@@ -242,10 +244,10 @@ class GroupTest {
242244
fun testCanStreamGroupsAndConversations() = kotlinx.coroutines.test.runTest {
243245
boClient.conversations.stream(includeGroups = true).test {
244246
val conversation =
245-
boClient.conversations.newConversation(alix.walletAddress)
247+
alixClient.conversations.newConversation(bo.walletAddress)
246248
assertEquals(conversation.topic, awaitItem().topic)
247249
val group =
248-
boClient.conversations.newGroup(listOf(alix.walletAddress))
250+
caroClient.conversations.newGroup(listOf(bo.walletAddress))
249251
assertEquals(group.id.toHex(), awaitItem().topic)
250252
}
251253
}

library/src/main/java/org/xmtp/android/library/Conversations.kt

-2
Original file line numberDiff line numberDiff line change
@@ -517,12 +517,10 @@ data class Conversations(
517517
fun streamGroups(): Flow<Group> = callbackFlow {
518518
val groupCallback = object : FfiConversationCallback {
519519
override fun onConversation(conversation: FfiGroup) {
520-
Log.e("LOPI", "callback called")
521520
trySend(Group(client, conversation))
522521
}
523522
}
524523

525-
Log.e("LOPI", "starting stream ${libXMTPConversations.toString()}")
526524
val stream = libXMTPConversations?.stream(groupCallback)
527525
awaitClose { stream?.end() }
528526
}

0 commit comments

Comments
 (0)