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

Feature request: ability to do batch queries #34

Closed
nmalzieu opened this issue May 17, 2023 · 1 comment
Closed

Feature request: ability to do batch queries #34

nmalzieu opened this issue May 17, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@nmalzieu
Copy link
Collaborator

Is your feature request related to a problem?

Converse syncs all messages for all conversations locally on the phone (so you can access your messages offline)

To do so, for performance reasons (some people have thousands of conversations) we don't call conversation.messages() for each conversation, but we use client.apiClient.batchQuery and send many topics to get back messages from many conversations at once, then we decode the envelopes ourselves (open issue xmtp/xmtp-js#315 to be able to do it without decoding the envelopes ourselves btw)

This does not seem to be possible in the React Native SDK.
More : calling conversation.messages() seems to return max 100 messages (while the JS SDK returns everything and handles the pagination etc)

Describe the solution to the problem

Multiple solutions possible:

  • add a way to fetch messages for many topics all at once (and the decoding of messages is done by the SDK, like Feature request: BatchListMessages xmtp-js#315)
  • add a way to do batch queries using the RN SDK: then we also need access to the decoding methods of the SDK directly in RN

Also, conversation.messages() should return all messages, not just 100

Describe the uses cases for the feature

Mostly mobile apps to sync all convos

Additional details

No response

@dmccartney
Copy link
Contributor

Batch listing of messages is now completed for RN on both Android and iOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants