@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Deduplicate application-level notifications from Aphlict

Summary:
Fixes T12564. We already had some code which seems to deal with this properly, it just wasn't getting used.

Assign each application-level notification a unique ID, then ignore messages with duplicate IDs.

Test Plan:
- In browser A, loaded `/T123`.
- In browser B, loaded `/T123`.
- Made a comment as B.
- Saw notification as A.
- Mashed "Replay" a bunch.
- Before patch: piles of duplicate notifications.
- After patch: no duplicates.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12564

Differential Revision: https://secure.phabricator.com/D17710

+18 -11
+10 -10
resources/celerity/map.php
··· 10 10 'conpherence.pkg.css' => 'a34d59bd', 11 11 'conpherence.pkg.js' => '5f86c17d', 12 12 'core.pkg.css' => '959330a2', 13 - 'core.pkg.js' => '1cedf416', 13 + 'core.pkg.js' => '2e969052', 14 14 'darkconsole.pkg.js' => '31272f61', 15 15 'differential.pkg.css' => '90b30783', 16 16 'differential.pkg.js' => 'ddfeb49b', ··· 361 361 'rsrc/image/texture/table_header.png' => '5c433037', 362 362 'rsrc/image/texture/table_header_hover.png' => '038ec3b9', 363 363 'rsrc/image/texture/table_header_tall.png' => 'd56b434f', 364 - 'rsrc/js/application/aphlict/Aphlict.js' => '7cacce98', 364 + 'rsrc/js/application/aphlict/Aphlict.js' => '9b5dda26', 365 365 'rsrc/js/application/aphlict/behavior-aphlict-dropdown.js' => 'caade6f2', 366 366 'rsrc/js/application/aphlict/behavior-aphlict-listen.js' => 'd82b1ff9', 367 367 'rsrc/js/application/aphlict/behavior-aphlict-status.js' => '5e2634b9', ··· 583 583 'herald-rule-editor' => 'd6a7e717', 584 584 'herald-test-css' => 'a52e323e', 585 585 'inline-comment-summary-css' => '51efda3a', 586 - 'javelin-aphlict' => '7cacce98', 586 + 'javelin-aphlict' => '9b5dda26', 587 587 'javelin-behavior' => '61cbc29a', 588 588 'javelin-behavior-aphlict-dropdown' => 'caade6f2', 589 589 'javelin-behavior-aphlict-listen' => 'd82b1ff9', ··· 1468 1468 'owners-path-editor', 1469 1469 'javelin-behavior', 1470 1470 ), 1471 - '7cacce98' => array( 1472 - 'javelin-install', 1473 - 'javelin-util', 1474 - 'javelin-websocket', 1475 - 'javelin-leader', 1476 - 'javelin-json', 1477 - ), 1478 1471 '7cbe244b' => array( 1479 1472 'javelin-install', 1480 1473 'javelin-util', ··· 1685 1678 '9a8cb501' => array( 1686 1679 'aphront-typeahead-control-css', 1687 1680 'phui-tag-view-css', 1681 + ), 1682 + '9b5dda26' => array( 1683 + 'javelin-install', 1684 + 'javelin-util', 1685 + 'javelin-websocket', 1686 + 'javelin-leader', 1687 + 'javelin-json', 1688 1688 ), 1689 1689 '9bbf3762' => array( 1690 1690 'javelin-behavior',
+5
src/applications/notification/client/PhabricatorNotificationClient.php
··· 18 18 } 19 19 20 20 public static function tryToPostMessage(array $data) { 21 + $unique_id = Filesystem::readRandomCharacters(32); 22 + $data = $data + array( 23 + 'uniqueID' => $unique_id, 24 + ); 25 + 21 26 $servers = PhabricatorNotificationServerRef::getEnabledAdminServers(); 22 27 23 28 shuffle($servers);
+3 -1
webroot/rsrc/js/application/aphlict/Aphlict.js
··· 130 130 131 131 _message: function(raw) { 132 132 var message = JX.JSON.parse(raw); 133 - JX.Leader.broadcast(null, {type: 'aphlict.server', data: message}); 133 + var id = message.uniqueID || null; 134 + 135 + JX.Leader.broadcast(id, {type: 'aphlict.server', data: message}); 134 136 }, 135 137 136 138 _receive: function(message, is_leader) {