Ignore new messages when lists are behind.

If individual messages arrive before we get the latest
messages from the server, they can create gaps in rendering,
and would often be offscreen anyway, so we just ignore them.
This commit is contained in:
Steve Howell
2018-03-20 13:51:28 -04:00
committed by Tim Abbott
parent 4e431516bf
commit bcdd12773e
3 changed files with 11 additions and 0 deletions

View File

@@ -42,6 +42,11 @@ exports.MessageList.prototype = {
var bottom_messages = [];
var interior_messages = [];
if (opts.messages_are_new && !self.fetch_status.can_append()) {
blueslip.log('Ignoring new message(s) for list that is behind on fetches');
return;
}
// If we're initially populating the list, save the messages in
// bottom_messages regardless
if (self.selected_id() === -1 && self.empty()) {