Bug 955665 - executeSoon calls pile up on addPendingChats, causing jank, r=nhnt11.
authoraleth <aleth@instantbird.org>
Mon, 14 Oct 2013 20:30:07 +0200
changeset 17300 a6bef6c9556acce7610e2231dfafb4823a23c54f
parent 17299 211c86885af24058f73d8cc640b93389d5cceb15
child 17301 ab630c829a4b942a61569c98ce6975f2eedad5c6
push id1151
push userbugzilla@standard8.plus.com
push dateMon, 03 Feb 2014 22:50:32 +0000
treeherdercomm-aurora@267d8e9143d5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnhnt11
bugs955665
Bug 955665 - executeSoon calls pile up on addPendingChats, causing jank, r=nhnt11.
im/components/ibConvStatsService.js
--- a/im/components/ibConvStatsService.js
+++ b/im/components/ibConvStatsService.js
@@ -255,23 +255,24 @@ ConvStatsService.prototype = {
       }
       let possibleConv = new PossibleChat(chat);
       let pos = this._getPositionToInsert(possibleConv, this._convs);
       this._convs.splice(pos, 0, possibleConv);
       chatList.set(chat.name, possibleConv);
     }
     if (this._pendingChats.length)
       executeSoon(this._addPendingChats.bind(this));
+    else
+      delete this._addingPendingChats;
     let now = Date.now();
     if ((!this._accountsRequestingRoomInfo.size && !this._pendingChats.length) ||
         now - this._lastUpdateNotification > 100) {
       this._notifyObservers("updated");
       this._lastUpdateNotification = now;
     }
-    delete this._addingPendingChats;
   },
 
   _removeChatsForAccount: function(aAccId) {
     if (!this._chatsByAccountIdAndName.has(aAccId))
       return;
     // Keep only convs that either aren't chats or have a different account id.
     this._convs = this._convs.filter(function(c)
       c.source != "chat" || c.accountId != aAccId);