Skip to content

Commit

Permalink
fix the synchronous issue
Browse files Browse the repository at this point in the history
  • Loading branch information
nplasterer committed Feb 14, 2024
1 parent 0a8cd4b commit 22d2b28
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ PODS:
- GenericJSON (~> 2.0)
- Logging (~> 1.0.0)
- secp256k1.swift (~> 0.1)
- XMTP (0.8.4):
- XMTP (0.8.5):
- Connect-Swift (= 0.3.0)
- GzipSwift
- LibXMTP (= 0.4.1-beta3)
Expand All @@ -451,7 +451,7 @@ PODS:
- ExpoModulesCore
- MessagePacker
- secp256k1.swift
- XMTP (= 0.8.4)
- XMTP (= 0.8.5)
- Yoga (1.14.0)

DEPENDENCIES:
Expand Down Expand Up @@ -744,8 +744,8 @@ SPEC CHECKSUMS:
secp256k1.swift: a7e7a214f6db6ce5db32cc6b2b45e5c4dd633634
SwiftProtobuf: b02b5075dcf60c9f5f403000b3b0c202a11b6ae1
web3.swift: 2263d1e12e121b2c42ffb63a5a7beb1acaf33959
XMTP: fe278c4c9e2d71b607c1816d16a37a1f8fef83f1
XMTPReactNative: b5b61eb97c27848d26f87043cb3845059968b5e5
XMTP: 1957e318059e8723bc1e76b1723c1eeb98e7760b
XMTPReactNative: 048504b17f0a7f9380b48ddeda6bfb15f7a5d799
Yoga: e71803b4c1fff832ccf9b92541e00f9b873119b9

PODFILE CHECKSUM: 95d6ace79946933ecf80684613842ee553dd76a2
Expand Down
9 changes: 5 additions & 4 deletions example/src/tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,23 +227,24 @@ test('can message in a group', async () => {
) {
throw new Error('missing address')
}
await bobClient.conversations.syncGroups()

// Alice can send messages
aliceGroup.send('hello, world')
aliceGroup.send('gm')
await aliceGroup.send('hello, world')
await aliceGroup.send('gm')

// Bob's num groups == 1
await bobClient.conversations.syncGroups()
const bobGroups = await bobClient.conversations.listGroups()
if (bobGroups.length !== 1) {
throw new Error(
'num groups for bob should be 1, but it is' + bobGroups.length
)
}

delayToPropogate()
// Bob can read messages from Alice
await bobGroups[0].sync()
const bobMessages: DecodedMessage[] = await bobGroups[0].messages()

if (bobMessages.length !== 2) {
throw new Error(
'num messages for bob should be 2, but it is' + bobMessages.length
Expand Down
3 changes: 1 addition & 2 deletions ios/XMTPModule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -426,11 +426,10 @@ public class XMTPModule: Module {
}

let sending = try ContentJson.fromJson(contentJson)
try await group.send(
return try await group.send(
content: sending.content,
options: SendOptions(contentType: sending.type)
)
return group.id.toHex
}

AsyncFunction("prepareMessage") { (
Expand Down
2 changes: 1 addition & 1 deletion ios/XMTPReactNative.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ Pod::Spec.new do |s|
s.source_files = "**/*.{h,m,swift}"
s.dependency 'secp256k1.swift'
s.dependency "MessagePacker"
s.dependency "XMTP", "= 0.8.4"
s.dependency "XMTP", "= 0.8.5"
end
2 changes: 1 addition & 1 deletion src/lib/Group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export class Group<
content
)
} catch (e) {
console.info('ERROR in send()', e)
console.info('ERROR in send()', e.message)
throw e
}
}
Expand Down

0 comments on commit 22d2b28

Please sign in to comment.