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: Starting a new conversation fails with some wallet addresses #92

Open
bselwe opened this issue Oct 17, 2023 · 0 comments
Open

Bug: Starting a new conversation fails with some wallet addresses #92

bselwe opened this issue Oct 17, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@bselwe
Copy link

bselwe commented Oct 17, 2023

Describe the bug

Starting a new conversation might throw an exception when the peer's contact is cached.

The method that throws when starting a conversation:

var peerContact = await contacts.getUserContactV2(peer.hex);

Thrown error
StateError (Bad state: No element)
#0      ListBase.firstWhere (dart:collection/list.dart:132:5)
#1      ContactManager.getUserContactV2 (package:xmtp/src/contact.dart:59:25)
<asynchronous suspension>
#2      ConversationManagerV2.newConversation (package:xmtp/src/conversation/conversation_v2.dart:52:23)
<asynchronous suspension>
#3      _conversationsIsolateEntry.<anonymous closure> (package:orb/component/xmtp/conversations_client.dart:290:17)

It seems that getUserContactV2 looks for v2 user contacts. However, getUserContacts might return a cached list of user contacts that only contains v1 contacts with the given wallet address. At this point, the method breaks as it expects at least one contact to be v2.

Expected behavior

The user can start a conversation with any wallet address.

Steps to reproduce the bug

No response

@bselwe bselwe added the bug Something isn't working label Oct 17, 2023
@humanagent humanagent self-assigned this Nov 4, 2023
@humanagent humanagent removed their assignment Dec 19, 2023
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

2 participants