hasMore, loadMore messages with queryMessages on ts-sdk

I use function queryMessages to query paged messages in a channel:
const result = await queryMessages({ subChannelId: channelId });
Although the response of API has the value: { "next": "eyJiZWZvcmUiOiI2M2YzMTlhNjU5OGQ5Y2ZmZGVjYmJiMjciLCJsaW1pdCI6MTAsInNlZ21lbnQiOjIwfQ==", "total": 29 }.
I decoded the value of the next property and got: { "before": "63f319a6598d9cffdecbbb27", "limit": 10, "segment": 20 }
When I log the result of queryMessages, it has the nextPage property with the value: { "after": undefined, "limit": 10 }. So, I can’t get the next page.
What am I wrong?

I also followed the documents on the link: https://eko.gitbook.io/archives/chat/typescript-react-native/patterns-and-caching/runquery-pattern#pagination. But the result was the same.

Hey @baodongle,

Thank you for reaching out. That seems like something I am able to reproduce.
I will raise a ticket and will keep you updated on the progress.

1 Like

@baodongle Update on this.
I’ve fixed the issue and it will most likely be part of the release on Friday 24 Feb 2023.
If there is a change to that plan, I’ll keep you posted.