1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-29 16:43:09 +03:00

Merge pull request #73 from matrix-org/rav/fix_timeline_tightloop

Make sure we don't end up calling /messages in a loop if things go weird
This commit is contained in:
Richard van der Hoff
2016-02-03 15:14:41 +01:00

View File

@@ -246,7 +246,11 @@ TimelineWindow.prototype.paginate = function(direction, size, makeRequest) {
// end of timeline // end of timeline
return false; return false;
} }
return self.paginate(direction, size); // recurse to advance the index into the results, but before we do, set
// makeRequest=false. It's not an absolute given that the paginate
// request returned events which we can now use, but we certainly don't
// want to get stuck in a tight loop here if things start going wrong.
return self.paginate(direction, size, false);
}); });
tl.pendingPaginate = prom; tl.pendingPaginate = prom;
return prom; return prom;