1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-19 20:10:55 +01:00

Conpherence - update the "unread" count in notifications panel aggressively

Summary:
Fixes T7561. Basically everytime we load some transactions in the thread manager, kick off an async thread to update the notification panel.

Should I consolidate this little bit of code into something like this._handleTransactionResponse(r)... ?  I just want to keep the JS clear for other engineers and I wasn't sure if that was hiding a bit too much detail.

Test Plan: user a opened durable column. user b sent user a a few messages. reloaded user a page and noted the "N" count became N-1 as the message loaded. Switched messages and saw N-2, N-3, etc as I loaded up the messages.

Reviewers: chad, epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T7561

Differential Revision: https://secure.phabricator.com/D12099
This commit is contained in:
Bob Trahan 2015-03-17 13:40:36 -07:00
parent 7a93b443c3
commit 8fe78c9029
2 changed files with 20 additions and 13 deletions

View file

@ -352,7 +352,7 @@ return array(
'rsrc/js/application/aphlict/behavior-aphlict-status.js' => 'ea681761',
'rsrc/js/application/auth/behavior-persona-login.js' => '9414ff18',
'rsrc/js/application/config/behavior-reorder-fields.js' => '14a827de',
'rsrc/js/application/conpherence/ConpherenceThreadManager.js' => 'bbc850a4',
'rsrc/js/application/conpherence/ConpherenceThreadManager.js' => '6a9169bb',
'rsrc/js/application/conpherence/behavior-durable-column.js' => 'e975bd12',
'rsrc/js/application/conpherence/behavior-menu.js' => 'c4151295',
'rsrc/js/application/conpherence/behavior-pontificate.js' => '21ba5861',
@ -517,7 +517,7 @@ return array(
'conpherence-menu-css' => 'c6ac5299',
'conpherence-message-pane-css' => '2526107d',
'conpherence-notification-css' => '04a6e10a',
'conpherence-thread-manager' => 'bbc850a4',
'conpherence-thread-manager' => '6a9169bb',
'conpherence-update-css' => '1099a660',
'conpherence-widget-pane-css' => '3d575438',
'differential-changeset-view-css' => '6a8b172a',
@ -1270,6 +1270,16 @@ return array(
'69adf288' => array(
'javelin-install',
),
'6a9169bb' => array(
'javelin-dom',
'javelin-util',
'javelin-stratcom',
'javelin-install',
'javelin-workflow',
'javelin-router',
'javelin-behavior-device',
'javelin-vector',
),
'6c2b09a2' => array(
'javelin-install',
'javelin-util',
@ -1684,16 +1694,6 @@ return array(
'javelin-stratcom',
'javelin-dom',
),
'bbc850a4' => array(
'javelin-dom',
'javelin-util',
'javelin-stratcom',
'javelin-install',
'javelin-workflow',
'javelin-router',
'javelin-behavior-device',
'javelin-vector',
),
'bbdf75ca' => array(
'javelin-behavior',
'javelin-dom',

View file

@ -202,8 +202,10 @@ JX.install('ConpherenceThreadManager', {
return;
}
}
this._latestTransactionID = r.latest_transaction_id;
this._updating.knownID = r.latest_transaction_id;
this._latestTransactionID = r.latest_transaction_id;
JX.Stratcom.invoke('notification-panel-update', null, {});
this._didUpdateThreadCallback(r);
}));
@ -234,6 +236,8 @@ JX.install('ConpherenceThreadManager', {
.setHandler(JX.bind(this, function(r) {
if (this._shouldUpdateDOM(r)) {
this._latestTransactionID = r.latest_transaction_id;
JX.Stratcom.invoke('notification-panel-update', null, {});
this._didUpdateWorkflowCallback(r);
}
}));
@ -259,6 +263,7 @@ JX.install('ConpherenceThreadManager', {
this._loadedThreadID = r.threadID;
this._loadedThreadPHID = r.threadPHID;
this._latestTransactionID = r.latestTransactionID;
JX.Stratcom.invoke('notification-panel-update', null, {});
this._didLoadThreadCallback(r);
});
@ -279,6 +284,8 @@ JX.install('ConpherenceThreadManager', {
.setHandler(JX.bind(this, function(r) {
if (this._shouldUpdateDOM(r)) {
this._latestTransactionID = r.latest_transaction_id;
JX.Stratcom.invoke('notification-panel-update', null, {});
this._didSendMessageCallback(r);
}
}));