xmtp / xmtp-flutter

XMTP client SDK for Flutter applications written in Dart.
MIT License
31 stars 6 forks source link

Bug: Incomplete Message Retrieval from SDK (Limit: 100 Messages) #71

Closed nileshrathore closed 1 year ago

nileshrathore commented 1 year ago

Describe the bug

I have encountered a limitation with the SDK where it only returns a maximum of 100 latest messages from a chat, even if the chat contains more than 100 messages.

Expected behavior

No response

Steps to reproduce the bug

No response

nplasterer commented 1 year ago

Similar to my comment here: https://github.com/xmtp/xmtp-flutter/issues/70#issuecomment-1624174141

This is due to the query only fetching the first page. We'll need to make a call to an envelopes method (which may need to be written) that does a query through all of the pages. We recently fixed this in iOS and Android https://github.com/xmtp/xmtp-android/pull/88

I think this one is going to be a little more complicated because it makes use of the batch query method since it can take multiple conversations.

https://github.com/xmtp/xmtp-flutter/blob/main/lib/src/conversation/conversation_v2.dart#L231-L234 https://github.com/xmtp/xmtp-flutter/blob/main/lib/src/conversation/conversation_v1.dart#L139-L142