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: Incomplete Conversation Retrieval from SDK (Limit: 102 Conversations) #70

Closed
nileshrathore opened this issue Jun 20, 2023 · 1 comment · Fixed by #81
Closed

Bug: Incomplete Conversation Retrieval from SDK (Limit: 102 Conversations) #70

nileshrathore opened this issue Jun 20, 2023 · 1 comment · Fixed by #81
Labels
bug Something isn't working

Comments

@nileshrathore
Copy link

Describe the bug

I am currently experiencing a limitation with the SDK where it only returns a maximum of 102 conversations from my wallet, despite having around 200 conversations in my wallet.

Expected behavior

No response

Steps to reproduce the bug

No response

@nileshrathore nileshrathore added the bug Something isn't working label Jun 20, 2023
@nileshrathore nileshrathore changed the title Incomplete Conversation Retrieval from SDK (Limit: 102 Conversations) Bug: Incomplete Conversation Retrieval from SDK (Limit: 102 Conversations) Jun 20, 2023
@nplasterer
Copy link
Contributor

We recently fixed this bug in android https://github.com/xmtp/xmtp-android/pull/74/files it should be a simple fix from the query method to a batch envelopes method.

So in this code we should no longer be calling query
https://github.com/xmtp/xmtp-flutter/blob/main/lib/src/conversation/conversation_v2.dart#L93-L101

Instead it should look something like

var listing = await api.client.envelopes(xmtp.QueryRequest(
      contentTopics: [Topic.userInvite(_me.hex)],
      startTimeNs: start?.toNs64(),
      endTimeNs: end?.toNs64(),
      pagingInfo: xmtp.PagingInfo(
        limit: limit,
        direction: sort,
      ),
    ));

It's possible an envelopes method on the client doesn't exist yet and if thats the case you'll need to write something like this https://github.com/xmtp/xmtp-android/blob/main/library/src/main/java/org/xmtp/android/library/ApiClient.kt#L125-L136 to iterate through all the pages and return all the envelopes (conversations).

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

Successfully merging a pull request may close this issue.

2 participants