Skip to content

Commit

Permalink
verify not using multiple client objects when removing
Browse files Browse the repository at this point in the history
  • Loading branch information
cameronvoell committed Nov 19, 2024
1 parent bdc319e commit b8c962b
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,8 @@ class XMTPModule : Module() {
withContext(Dispatchers.IO) {
logV("removeGroupMembers")
val client = clients[inboxId] ?: throw XMTPException("No client")
val clientObjectHash = System.identityHashCode(client)
logV("hashcode of client object in memory performing removeGroupMembers: " + clientObjectHash)
val group = client.findGroup(groupId)
?: throw XMTPException("no group found for $groupId")
group.removeMembers(peerAddresses)
Expand Down Expand Up @@ -844,6 +846,16 @@ class XMTPModule : Module() {
}
}

AsyncFunction("printNumClients") Coroutine { inboxId: String, groupId: String ->
withContext(Dispatchers.IO) {
logV("isGroupActive")
val client = clients[inboxId] ?: throw XMTPException("No client")
val group = client.findGroup(groupId)
?: throw XMTPException("no group found for $groupId")
group.isActive()
}
}

AsyncFunction("addedByInboxId") Coroutine { inboxId: String, groupId: String ->
withContext(Dispatchers.IO) {
logV("addedByInboxId")
Expand Down

0 comments on commit b8c962b

Please sign in to comment.