From f2787d862e8ea35b160e8b15ddfb80eb5fcb4bc9 Mon Sep 17 00:00:00 2001 From: Naomi Plasterer Date: Tue, 13 Feb 2024 08:26:53 -0800 Subject: [PATCH] fix up the is active test --- .../java/org/xmtp/android/library/GroupTest.kt | 8 ++++++-- library/src/main/java/org/xmtp/android/library/Group.kt | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) 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 9ab8fcd86..cb85dff02 100644 --- a/library/src/androidTest/java/org/xmtp/android/library/GroupTest.kt +++ b/library/src/androidTest/java/org/xmtp/android/library/GroupTest.kt @@ -121,9 +121,13 @@ class GroupTest { caro.walletAddress ) ) + runBlocking { caroClient.conversations.syncGroups() } + val caroGroup = caroClient.conversations.listGroups().first() + assert(caroGroup.isActive()) assert(group.isActive()) - group.removeMembers(listOf(bo.walletAddress)) - assert(!group.isActive()) + group.removeMembers(listOf(caro.walletAddress)) + assert(group.isActive()) + assert(!caroGroup.isActive()) } @Test diff --git a/library/src/main/java/org/xmtp/android/library/Group.kt b/library/src/main/java/org/xmtp/android/library/Group.kt index a425da20d..d1a4ed37b 100644 --- a/library/src/main/java/org/xmtp/android/library/Group.kt +++ b/library/src/main/java/org/xmtp/android/library/Group.kt @@ -129,6 +129,7 @@ class Group(val client: Client, private val libXMTPGroup: FfiGroup) { } fun isActive(): Boolean { + runBlocking { libXMTPGroup.sync() } return libXMTPGroup.isActive() }