xmtp / xmtp-ios

XMTP client SDK for iOS applications written in Swift.
MIT License
34 stars 24 forks source link

Conversations are not shown between different platforms #28

Closed Cordt closed 1 year ago

Cordt commented 1 year ago

Context We implemented an iOS Client using the SDK to allow for simple messaging between clients. Discovery of conversation partners is enabled via Lens handles.

Problem Though it is possible to successfully create and receive conversations, as well as write and receive messages, these conversations are not visible across different platforms.

We have tested this both on dev and production networks resulting in exactly the same behaviour.

As I understand the implementation of the SDK, it should default to v2 Conversations without additional setup. I also dumped the conversations on the console to verify this, which shows the following

XMTP.Conversation.v2(
  XMTP.ConversationV2(
    topic: "/xmtp/0/.../proto", 
    keyMaterial: 32 bytes, 
    context: XMTPProto.Xmtp_MessageContents_InvitationV1.Context:, 
    peerAddress: "...", 
    client: XMTP.Client, 
    header: XMTPProto.Xmtp_MessageContents_SealedInvitationHeaderV1:
    ...

Please let me know whether more context is needed to dig into this issue!

nakajima commented 1 year ago

Hmm, I seem to be able to see conversations/messages between the browser and the iOS example app:

https://user-images.githubusercontent.com/483/210890479-c9b59e30-2764-4f56-ac2e-5f34721962ee.mov

Are you noticing any errors in the console? Are you using different conversationIDs?

Cordt commented 1 year ago

Not making use of conversationIds at all and don't see any error messages. Will try with the example apps as well and see whether I get different behaviour. The main difference between lentil and the example app is that I don't use the integrated WalletConnect.

Cordt commented 1 year ago

@nakajima Just verified: The same conversations that are shown in lentil are shown in the Example app as well, but are not shown in Lenster. I therefore assume that Lenster might be doing something different. Will ask the team about it

saulmc commented 1 year ago

@Cordt Wait. That might be working as intended. Lenster uses the Lens DMs converationId and explicitly disregards any messages that don't have it. If you use the Lens DMs conversationId when initiating conversations in Lentil, do they appear in Lenster?

https://xmtp.org/docs/client-sdk/javascript/tutorials/build-key-xmtp-chat-features-in-a-lens-app#build-the-lens-dm-conversation-id

Cordt commented 1 year ago

@saulmc Agreed, that appears to be the issue. I think that in that case there is a Bug in the library then, because I don't filter on .list() at all, so the Lens Conversations should definitely be returned on my end, which they don't

Cordt commented 1 year ago

Updating to the newest version of the repo fixes this issue.

Conversations that were created using an older version do not show up anymore, but this issue seems to be isolated to this SDK (iOS).