1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 00:42:41 +01:00

After a reconnect, repaint Conpherence thread state

Summary: Ref T12566. When we reconnect, refresh the current thread even if we replayed notifications.

Test Plan:
  - Clicked the "Repaint" button, saw the thread refresh.
  - Clicked the "Reconnect" button, saw the thread reresh.
  - Launched `aphlict debug`, killed it, restarted it, saw the thread refresh after reconnect.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12566

Differential Revision: https://secure.phabricator.com/D17713
This commit is contained in:
epriestley 2017-04-17 15:08:51 -07:00
parent eaecf35324
commit ffed156981
6 changed files with 85 additions and 56 deletions

View file

@ -10,8 +10,8 @@ return array(
'conpherence.pkg.css' => 'a34d59bd',
'conpherence.pkg.js' => '5f86c17d',
'core.pkg.css' => '959330a2',
'core.pkg.js' => '2e969052',
'darkconsole.pkg.js' => '31272f61',
'core.pkg.js' => '349e50d5',
'darkconsole.pkg.js' => '1f9a31bc',
'differential.pkg.css' => '90b30783',
'differential.pkg.js' => 'ddfeb49b',
'diffusion.pkg.css' => '91c5d3a6',
@ -361,16 +361,16 @@ return array(
'rsrc/image/texture/table_header.png' => '5c433037',
'rsrc/image/texture/table_header_hover.png' => '038ec3b9',
'rsrc/image/texture/table_header_tall.png' => 'd56b434f',
'rsrc/js/application/aphlict/Aphlict.js' => '9b5dda26',
'rsrc/js/application/aphlict/Aphlict.js' => '6304947a',
'rsrc/js/application/aphlict/behavior-aphlict-dropdown.js' => 'caade6f2',
'rsrc/js/application/aphlict/behavior-aphlict-listen.js' => 'd82b1ff9',
'rsrc/js/application/aphlict/behavior-aphlict-listen.js' => '06e7f30e',
'rsrc/js/application/aphlict/behavior-aphlict-status.js' => '5e2634b9',
'rsrc/js/application/aphlict/behavior-desktop-notifications-control.js' => 'd5a2d665',
'rsrc/js/application/calendar/behavior-day-view.js' => '4b3c4443',
'rsrc/js/application/calendar/behavior-event-all-day.js' => 'b41537c9',
'rsrc/js/application/calendar/behavior-month-view.js' => 'fe33e256',
'rsrc/js/application/config/behavior-reorder-fields.js' => 'b6993408',
'rsrc/js/application/conpherence/ConpherenceThreadManager.js' => 'c8b5ee6f',
'rsrc/js/application/conpherence/ConpherenceThreadManager.js' => 'dd84a70f',
'rsrc/js/application/conpherence/behavior-conpherence-search.js' => '9bbf3762',
'rsrc/js/application/conpherence/behavior-durable-column.js' => 'aa3bd034',
'rsrc/js/application/conpherence/behavior-menu.js' => '80dda04a',
@ -522,7 +522,7 @@ return array(
'rsrc/js/core/behavior-workflow.js' => '0a3f3021',
'rsrc/js/core/darkconsole/DarkLog.js' => 'c8e1ffe3',
'rsrc/js/core/darkconsole/DarkMessage.js' => 'c48cccdd',
'rsrc/js/core/darkconsole/behavior-dark-console.js' => '2a228a94',
'rsrc/js/core/darkconsole/behavior-dark-console.js' => '17bb8539',
'rsrc/js/core/phtize.js' => 'd254d646',
'rsrc/js/phui/behavior-phui-dropdown-menu.js' => 'b95d6f7d',
'rsrc/js/phui/behavior-phui-file-upload.js' => 'b003d4fb',
@ -560,7 +560,7 @@ return array(
'conpherence-message-pane-css' => '14199428',
'conpherence-notification-css' => 'cef0a3fc',
'conpherence-participant-pane-css' => '26a3ce56',
'conpherence-thread-manager' => 'c8b5ee6f',
'conpherence-thread-manager' => 'dd84a70f',
'conpherence-transaction-css' => '85129c68',
'd3' => 'a11a5ff2',
'differential-changeset-view-css' => '41af6d25',
@ -583,10 +583,10 @@ return array(
'herald-rule-editor' => 'd6a7e717',
'herald-test-css' => 'a52e323e',
'inline-comment-summary-css' => '51efda3a',
'javelin-aphlict' => '9b5dda26',
'javelin-aphlict' => '6304947a',
'javelin-behavior' => '61cbc29a',
'javelin-behavior-aphlict-dropdown' => 'caade6f2',
'javelin-behavior-aphlict-listen' => 'd82b1ff9',
'javelin-behavior-aphlict-listen' => '06e7f30e',
'javelin-behavior-aphlict-status' => '5e2634b9',
'javelin-behavior-aphront-basic-tokenizer' => 'b3a4b884',
'javelin-behavior-aphront-drag-and-drop-textarea' => '484a6e22',
@ -605,7 +605,7 @@ return array(
'javelin-behavior-conpherence-pontificate' => '55616e04',
'javelin-behavior-conpherence-search' => '9bbf3762',
'javelin-behavior-countdown-timer' => 'e4cc26b3',
'javelin-behavior-dark-console' => '2a228a94',
'javelin-behavior-dark-console' => '17bb8539',
'javelin-behavior-dashboard-async-panel' => '469c0d9e',
'javelin-behavior-dashboard-move-panels' => '408bf173',
'javelin-behavior-dashboard-query-panel-select' => '453c5375',
@ -947,6 +947,20 @@ return array(
'javelin-stratcom',
'javelin-workflow',
),
'06e7f30e' => array(
'javelin-behavior',
'javelin-aphlict',
'javelin-stratcom',
'javelin-request',
'javelin-uri',
'javelin-dom',
'javelin-json',
'javelin-router',
'javelin-util',
'javelin-leader',
'javelin-sound',
'phabricator-notification',
),
'0825c27a' => array(
'javelin-behavior',
'javelin-dom',
@ -1016,6 +1030,16 @@ return array(
'javelin-dom',
'javelin-history',
),
'17bb8539' => array(
'javelin-behavior',
'javelin-stratcom',
'javelin-util',
'javelin-dom',
'javelin-request',
'phabricator-keyboard-shortcut',
'phabricator-darklog',
'phabricator-darkmessage',
),
'185bbd53' => array(
'javelin-install',
),
@ -1089,16 +1113,6 @@ return array(
'javelin-install',
'javelin-util',
),
'2a228a94' => array(
'javelin-behavior',
'javelin-stratcom',
'javelin-util',
'javelin-dom',
'javelin-request',
'phabricator-keyboard-shortcut',
'phabricator-darklog',
'phabricator-darkmessage',
),
'2b8de964' => array(
'javelin-install',
'javelin-util',
@ -1377,6 +1391,13 @@ return array(
'javelin-install',
'javelin-util',
),
'6304947a' => array(
'javelin-install',
'javelin-util',
'javelin-websocket',
'javelin-leader',
'javelin-json',
),
'635de1ec' => array(
'javelin-behavior',
'javelin-stratcom',
@ -1679,13 +1700,6 @@ return array(
'aphront-typeahead-control-css',
'phui-tag-view-css',
),
'9b5dda26' => array(
'javelin-install',
'javelin-util',
'javelin-websocket',
'javelin-leader',
'javelin-json',
),
'9bbf3762' => array(
'javelin-behavior',
'javelin-dom',
@ -1967,17 +1981,6 @@ return array(
'c7ccd872' => array(
'phui-fontkit-css',
),
'c8b5ee6f' => array(
'javelin-dom',
'javelin-util',
'javelin-stratcom',
'javelin-install',
'javelin-aphlict',
'javelin-workflow',
'javelin-router',
'javelin-behavior-device',
'javelin-vector',
),
'c90a04fc' => array(
'javelin-dom',
'javelin-dynval',
@ -2086,26 +2089,23 @@ return array(
'javelin-dom',
'phabricator-draggable-list',
),
'd82b1ff9' => array(
'javelin-behavior',
'javelin-aphlict',
'javelin-stratcom',
'javelin-request',
'javelin-uri',
'javelin-dom',
'javelin-json',
'javelin-router',
'javelin-util',
'javelin-leader',
'javelin-sound',
'phabricator-notification',
),
'd835b03a' => array(
'javelin-behavior',
'javelin-dom',
'javelin-util',
'phabricator-shaped-request',
),
'dd84a70f' => array(
'javelin-dom',
'javelin-util',
'javelin-stratcom',
'javelin-install',
'javelin-aphlict',
'javelin-workflow',
'javelin-router',
'javelin-behavior-device',
'javelin-vector',
),
'de2e896f' => array(
'javelin-behavior',
'javelin-dom',

View file

@ -24,6 +24,7 @@ final class DarkConsoleRealtimePlugin extends DarkConsolePlugin {
$reconnect_label = pht('Reconnect');
$replay_label = pht('Replay');
$repaint_label = pht('Repaint');
$buttons = phutil_tag(
'div',
@ -51,6 +52,16 @@ final class DarkConsoleRealtimePlugin extends DarkConsolePlugin {
'action' => 'replay',
'label' => $replay_label,
)),
id(new PHUIButtonView())
->setIcon('fa-paint-brush')
->setColor(PHUIButtonView::GREY)
->setText($repaint_label)
->addSigil('dark-console-realtime-action')
->setMetadata(
array(
'action' => 'repaint',
'label' => $repaint_label,
)),
));
return phutil_tag(

View file

@ -99,17 +99,16 @@ JX.install('Aphlict', {
// after other tabs have had a chance to subscribe. Do this before we
// broadcast that the connection status is now open.
if (this._isReconnect) {
setTimeout(JX.bind(this, this._reconnect), 100);
setTimeout(JX.bind(this, this._didReconnect), 100);
}
this._broadcastStatus('open');
JX.Leader.broadcast(null, {type: 'aphlict.getsubscribers'});
},
_reconnect: function() {
_didReconnect: function() {
this.replay();
JX.Leader.broadcast(null, {type: 'aphlict.reconnect', data: null});
this.reconnect();
},
replay: function() {
@ -120,6 +119,10 @@ JX.install('Aphlict', {
JX.Leader.broadcast(null, {type: 'aphlict.replay', data: replay});
},
reconnect: function() {
JX.Leader.broadcast(null, {type: 'aphlict.reconnect', data: null});
},
_close: function() {
this._broadcastStatus('closed');
},

View file

@ -53,6 +53,10 @@ JX.behavior('aphlict-listen', function(config) {
case 'notification.individual':
JX.Stratcom.invoke('aphlict-notification-message', null, message.data);
break;
case 'aphlict.reconnect':
JX.Stratcom.invoke('aphlict-reconnect', null, message.data);
break;
}
}

View file

@ -240,6 +240,14 @@ JX.install('ConpherenceThreadManager', {
this._updateThread();
}));
// If we see a reconnect, always update the thread state.
JX.Stratcom.listen(
'aphlict-reconnect',
null,
JX.bind(this, function() {
this._updateThread();
}));
JX.Stratcom.listen(
'click',
'show-older-messages',

View file

@ -395,6 +395,9 @@ JX.behavior('dark-console', function(config, statics) {
case 'replay':
JX.Aphlict.getInstance().replay();
break;
case 'repaint':
JX.Aphlict.getInstance().reconnect();
break;
}
});