xmtp / xmtp-react-native

A package you can use to build with XMTP in a React Native or Expo app.
MIT License
41 stars 19 forks source link

Feature request: ability to do batch queries #34

Closed nmalzieu closed 1 year ago

nmalzieu commented 1 year ago

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 https://github.com/xmtp/xmtp-js/issues/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:

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 commented 1 year ago

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