mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	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:
		@@ -38,6 +38,8 @@ function blocked_older() {
 | 
			
		||||
    blocked_newer();
 | 
			
		||||
    blocked_older();
 | 
			
		||||
 | 
			
		||||
    assert(fetch_status.can_append());
 | 
			
		||||
 | 
			
		||||
    reset();
 | 
			
		||||
 | 
			
		||||
    fetch_status.start_initial_narrow();
 | 
			
		||||
 
 | 
			
		||||
@@ -45,6 +45,10 @@ var FetchStatus = function () {
 | 
			
		||||
        return !loading_newer && !found_newest;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    self.can_append = function () {
 | 
			
		||||
        return found_newest;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    return self;
 | 
			
		||||
 | 
			
		||||
};
 | 
			
		||||
 
 | 
			
		||||
@@ -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()) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user