Closed nmalzieu closed 1 year ago
Isn't this due the fact of page size limits? If there is a limit of < 100, use that as the page size. Otherwise use 100 and stop if/when limit reached.
@Jonathansoufer not sure I understand; in the web SDK, I think you just call conversation.messages()
and get back everything, am I mistaken? Is the goal for the RN SDK to work like the web one?
I'll try to replicate the behaviour on both SDKs and check what's going on then.
@Jonathansoufer I think the issue is a bit deeper than the react native SDK. I think the problem is that the iOS and Android SDKs just return the default from the protocol query method which is 100 messages. The SDKs have pagination but the client would have to do that to get all of the messages. In the JS SDK however we do that "pagination" for you in the SDK. So a call to messages will give you all the messages.
I think the fix here is actually going to be directly in the iOS and Android repos and changing client.query
to client.listEnvelopes
https://github.com/xmtp/xmtp-android/blob/main/library/src/main/java/org/xmtp/android/library/ConversationV2.kt#L61-L78
https://github.com/xmtp/xmtp-ios/blob/main/Sources/XMTP/ConversationV2.swift#L113-L126
I can open a fix in the Android repo if you'd like to take a stab at the iOS one. Let me know.
Sure. He comes the PR for the iOS one (https://github.com/xmtp/xmtp-ios/pull/117)
Describe the bug
conversation.messages()
seems to return max 100 messages => I think this is different than in the JS SDK which returns everything?Expected behavior
No response
Steps to reproduce the bug
No response