Skip to content

Commit

Permalink
Merge pull request #412 from xmtp/np/refactor-client-caching
Browse files Browse the repository at this point in the history
Find Client by inboxId not address
  • Loading branch information
nplasterer authored Jun 11, 2024
2 parents 76cc6ad + 99da6ca commit 58b4bb0
Show file tree
Hide file tree
Showing 12 changed files with 786 additions and 827 deletions.
505 changes: 254 additions & 251 deletions android/src/main/java/expo/modules/xmtpreactnativesdk/XMTPModule.kt

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class GroupWrapper {
GroupPermissions.ADMIN_ONLY -> "admin_only"
}
return mapOf(
"clientAddress" to client.address,
"id" to group.id.toHex(),
"createdAt" to group.createdAt.time,
"peerInboxIds" to group.peerInboxIds(),
Expand Down
8 changes: 4 additions & 4 deletions example/src/tests/groupTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ test('can make a MLS V3 client from bundle', async () => {
const group1 = await client.conversations.newGroup([anotherClient.address])

assert(
group1.clientAddress === client.address,
`clients dont match ${client.address} and ${group1.clientAddress}`
group1.client.address === client.address,
`clients dont match ${client.address} and ${group1.client.address}`
)

const bundle = await client.exportKeyBundle()
Expand Down Expand Up @@ -211,8 +211,8 @@ test('can make a MLS V3 client from bundle', async () => {
const group = await client2.conversations.newGroup([randomClient.address])

assert(
group.clientAddress === client2.address,
`clients dont match ${client2.address} and ${group.clientAddress}`
group.client.address === client2.address,
`clients dont match ${client2.address} and ${group.client.address}`
)

return true
Expand Down
4 changes: 2 additions & 2 deletions example/src/tests/tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -602,8 +602,8 @@ test('can stream messages', async () => {
})
await delayToPropogate()

if (bobConvo.clientAddress !== bob.address) {
throw Error('Unexpected client address ' + bobConvo.clientAddress)
if (bobConvo.client.address !== bob.address) {
throw Error('Unexpected client address ' + bobConvo.client.address)
}
if (!bobConvo.topic) {
throw Error('Missing topic ' + bobConvo.topic)
Expand Down
496 changes: 248 additions & 248 deletions ios/XMTPModule.swift

Large diffs are not rendered by default.

Loading

0 comments on commit 58b4bb0

Please sign in to comment.