Try to fix issue of pagination interfering with limited: true

This commit is contained in:
Nicolas Werner 2020-08-07 13:12:45 +02:00
parent 7eb0c4e09c
commit b972d827cb
1 changed files with 6 additions and 0 deletions

View File

@ -529,6 +529,12 @@ EventStore::fetchMore()
http::client()->messages(
opts, [this, opts](const mtx::responses::Messages &res, mtx::http::RequestErr err) {
if (cache::client()->previousBatchToken(room_id_) != opts.from) {
nhlog::net()->warn("Cache cleared while fetching more messages, dropping "
"/messages response");
emit fetchedMore();
return;
}
if (err) {
nhlog::net()->error("failed to call /messages ({}): {} - {} - {}",
opts.room_id,