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 346659cb5..748de0e5f 100644 --- a/library/src/androidTest/java/org/xmtp/android/library/GroupTest.kt +++ b/library/src/androidTest/java/org/xmtp/android/library/GroupTest.kt @@ -3,6 +3,7 @@ package org.xmtp.android.library import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.platform.app.InstrumentationRegistry import app.cash.turbine.test +import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.cancel import kotlinx.coroutines.flow.catch @@ -23,6 +24,7 @@ import org.xmtp.android.library.codecs.Reaction import org.xmtp.android.library.codecs.ReactionAction import org.xmtp.android.library.codecs.ReactionCodec import org.xmtp.android.library.codecs.ReactionSchema +import org.xmtp.android.library.codecs.id import org.xmtp.android.library.messages.MessageDeliveryStatus import org.xmtp.android.library.messages.PrivateKey import org.xmtp.android.library.messages.PrivateKeyBuilder @@ -432,6 +434,60 @@ class GroupTest { assertEquals(boClient.contacts.consentList.groupState(group.id), ConsentState.ALLOWED) } + @Test + fun testCanStreamAndUpdateNameWithoutForkingGroup() { + val firstMsgCheck = 2 + val secondMsgCheck = 5 + var messageCallbacks = 0 + + val job = CoroutineScope(Dispatchers.IO).launch { + try { + boClient.conversations.streamAllGroupMessages().collect { message -> + messageCallbacks++ + } + } catch (e: Exception) { + } + } + + val alixGroup = runBlocking { alixClient.conversations.newGroup(listOf(bo.walletAddress)) } + + runBlocking { + alixGroup.send("hello1") + alixGroup.updateGroupName("hello") + boClient.conversations.syncGroups() + } + + val boGroups = runBlocking { boClient.conversations.listGroups() } + assertEquals(boGroups.size, 1) + val boGroup = boGroups[0] + runBlocking { + boGroup.sync() + } + + val boMessages1 = boGroup.messages() + assertEquals(boMessages1.size, firstMsgCheck) + + runBlocking { + boGroup.send("hello2") + boGroup.send("hello3") + alixGroup.sync() + } + Thread.sleep(1000) + val alixMessages = alixGroup.messages() + assertEquals(alixMessages.size, secondMsgCheck) + runBlocking { + alixGroup.send("hello4") + boGroup.sync() + } + + val boMessages2 = boGroup.messages() + assertEquals(boMessages2.size, secondMsgCheck) + + Thread.sleep(1000) + + assertEquals(4, messageCallbacks) + } + @Test fun testCanSendMessageToGroup() { val group = runBlocking { boClient.conversations.newGroup(listOf(alix.walletAddress)) } diff --git a/library/src/main/java/libxmtp-version.txt b/library/src/main/java/libxmtp-version.txt index 637a2585c..bbec048c3 100644 --- a/library/src/main/java/libxmtp-version.txt +++ b/library/src/main/java/libxmtp-version.txt @@ -1,3 +1,3 @@ -Version: 6d880763 +Version: 68ac19c6 Branch: main -Date: 2024-06-13 06:20:50 +0000 +Date: 2024-06-17 17:37:54 +0000 diff --git a/library/src/main/jniLibs/arm64-v8a/libuniffi_xmtpv3.so b/library/src/main/jniLibs/arm64-v8a/libuniffi_xmtpv3.so index ceeedccfb..9ca0efc0e 100755 Binary files a/library/src/main/jniLibs/arm64-v8a/libuniffi_xmtpv3.so and b/library/src/main/jniLibs/arm64-v8a/libuniffi_xmtpv3.so differ diff --git a/library/src/main/jniLibs/armeabi-v7a/libuniffi_xmtpv3.so b/library/src/main/jniLibs/armeabi-v7a/libuniffi_xmtpv3.so index 6f768e79f..cfd1632c1 100755 Binary files a/library/src/main/jniLibs/armeabi-v7a/libuniffi_xmtpv3.so and b/library/src/main/jniLibs/armeabi-v7a/libuniffi_xmtpv3.so differ diff --git a/library/src/main/jniLibs/x86/libuniffi_xmtpv3.so b/library/src/main/jniLibs/x86/libuniffi_xmtpv3.so index befae0f4e..678cb06ee 100755 Binary files a/library/src/main/jniLibs/x86/libuniffi_xmtpv3.so and b/library/src/main/jniLibs/x86/libuniffi_xmtpv3.so differ diff --git a/library/src/main/jniLibs/x86_64/libuniffi_xmtpv3.so b/library/src/main/jniLibs/x86_64/libuniffi_xmtpv3.so index f55938875..d9d8ebc5d 100755 Binary files a/library/src/main/jniLibs/x86_64/libuniffi_xmtpv3.so and b/library/src/main/jniLibs/x86_64/libuniffi_xmtpv3.so differ