Is there a way to get the number of total messages of a particular read session using the Javascript SDK? We're syncing and reading the messages but the read method always returns true so we are not able to check wether we reached the end of our messages list.
This is a code snippet we're using:
async syncApp(user: string, readCount: number) {
const on_read = (count: any) => {
let msgs = mReadSession.getMessages();
};
let mReadSession = await this.mesibo.getInstance().readDbSession(user, 0, null, on_read)
// `res` is always true
let res = await mReadSession.read(readCount);
if (res < readCount) {
mReadSession.sync(readCount - res, on_read)
}
return mReadSession;
}