Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Swift SDK mixes up conversation without conversationId / conversations with empty conversationId #145

Closed
nmalzieu opened this issue Aug 11, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@nmalzieu
Copy link
Collaborator

Describe the bug

In the JS SDK, these return different conversations (different topics):

const convo1 = await xmtpClient.conversations.newConversation(
    "0x305DAfc577579c08109c9b732C78f192cCA952fd"
  );
  const convo2 = await xmtpClient.conversations.newConversation(
    "0x305DAfc577579c08109c9b732C78f192cCA952fd",
    { conversationId: "", metadata: {} }
  );

Convo 1 has convo1.context = undefined while convo2.context = {conversationId: "", metadata: {}}

But in Swift, if I get back the conversations from the same private key, I have no way to differentiate them from their conversationId.
Indeed the Swift SDK will return the both of them with context = {conversationId: "", metadata: {}} because of this line:
https://github.com/xmtp/xmtp-ios/blob/main/Sources/XMTP/ConversationV2.swift#L21

Expected behavior

I should be able to differentiate a conversation with an empty string for conversation Id from a conversation without any context in Swift

Steps to reproduce the bug

No response

@nmalzieu nmalzieu added the bug Something isn't working label Aug 11, 2023
@nplasterer
Copy link
Contributor

I think this should be fixed in the latest release that fixes a deterministic topics bug allowing duplicate conversations across all SDKs. After diving in the code mentioned above is actually stale and not used and the issue seemed to be related to how we do deterministic topics. Please feel free to reopen if that is not the case. I'd also advise updating the JS SDK as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants