mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-14 02:42:40 +01:00
Enable notifications by default
Summary: I think we've sorted out enough of the problems with these to turn them on for everyone. The real-time component remains configuration-dependent. Test Plan: Turned off "notification.enabled", still saw notifications. Reviewers: btrahan, chad Reviewed By: btrahan CC: aran Differential Revision: https://secure.phabricator.com/D4120
This commit is contained in:
parent
92678eb050
commit
bf9bc885b7
6 changed files with 37 additions and 39 deletions
|
@ -191,6 +191,9 @@ return array(
|
||||||
|
|
||||||
// -- Notifications --------------------------------------------------------- //
|
// -- Notifications --------------------------------------------------------- //
|
||||||
|
|
||||||
|
// Set this to true to enable real-time notifications. You must also run a
|
||||||
|
// notification server for this to work. Consult the documentation in
|
||||||
|
// "Notifications User Guide: Setup and Configuration" for instructions.
|
||||||
'notification.enabled' => false,
|
'notification.enabled' => false,
|
||||||
|
|
||||||
// Client port for the realtime server to listen on, and for realtime clients
|
// Client port for the realtime server to listen on, and for realtime clients
|
||||||
|
|
|
@ -99,8 +99,8 @@ final class PhabricatorFeedStoryPublisher {
|
||||||
implode(', ', $sql));
|
implode(', ', $sql));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PhabricatorEnv::getEnvConfig('notification.enabled')) {
|
|
||||||
$this->insertNotifications($chrono_key);
|
$this->insertNotifications($chrono_key);
|
||||||
|
if (PhabricatorEnv::getEnvConfig('notification.enabled')) {
|
||||||
$this->sendNotification($chrono_key);
|
$this->sendNotification($chrono_key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,6 @@ final class PhabricatorFeedStoryNotification extends PhabricatorFeedDAO {
|
||||||
PhabricatorUser $user,
|
PhabricatorUser $user,
|
||||||
$object_phid) {
|
$object_phid) {
|
||||||
|
|
||||||
if (PhabricatorEnv::getEnvConfig('notification.enabled')) {
|
|
||||||
$unguarded = AphrontWriteGuard::beginScopedUnguardedWrites();
|
$unguarded = AphrontWriteGuard::beginScopedUnguardedWrites();
|
||||||
|
|
||||||
$notification_table = new PhabricatorFeedStoryNotification();
|
$notification_table = new PhabricatorFeedStoryNotification();
|
||||||
|
@ -37,7 +36,6 @@ final class PhabricatorFeedStoryNotification extends PhabricatorFeedDAO {
|
||||||
|
|
||||||
unset($unguarded);
|
unset($unguarded);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public function countUnread(PhabricatorUser $user) {
|
public function countUnread(PhabricatorUser $user) {
|
||||||
$conn = $this->establishConnection('r');
|
$conn = $this->establishConnection('r');
|
||||||
|
|
|
@ -5,19 +5,20 @@ Guide to setting up notifications.
|
||||||
|
|
||||||
= Overview =
|
= Overview =
|
||||||
|
|
||||||
Phabricator can be configured to notify users when events happen in real time,
|
By default, Phabricator delivers information about events (like users creating
|
||||||
so they'll get a message in their browser window if something has happened or
|
tasks or commenting on code reviews) through email and in-application
|
||||||
the object they're looking at has been updated.
|
notifications.
|
||||||
|
|
||||||
NOTE: This feature is new and still needs some work.
|
Phabricator can also be configured to deliver notifications in real time, by
|
||||||
|
popping up by popping up a message in any open browser windows if something has
|
||||||
|
happened or an object has been updated.
|
||||||
|
|
||||||
= Enabling Notifications =
|
To enable real-time notifications:
|
||||||
|
|
||||||
To enable notifications, set `notification.enabled` to `true` in your
|
- Set `notification.enabled` in your configuration to true.
|
||||||
configuration. This will enable the notification menu in the menu bar, and
|
- Run the notification server, as described below.
|
||||||
notifications will be published when users take actions.
|
|
||||||
|
|
||||||
NOTE: This setting will be turned on for everyone soon.
|
This document describes the process in detail.
|
||||||
|
|
||||||
= Running the Aphlict Server =
|
= Running the Aphlict Server =
|
||||||
|
|
||||||
|
@ -52,7 +53,7 @@ You may want to adjust these settings:
|
||||||
aphlict is restarted.
|
aphlict is restarted.
|
||||||
|
|
||||||
In most cases, the defaults are appropriate, except that you should set
|
In most cases, the defaults are appropriate, except that you should set
|
||||||
`notification.user` to some valid user so Aphlict isn't running as root.
|
`notification.user` to some valid system user so Aphlict isn't running as root.
|
||||||
|
|
||||||
== Verifying Server Status ==
|
== Verifying Server Status ==
|
||||||
|
|
||||||
|
@ -62,13 +63,11 @@ server is working. If it isn't working, you should see an error.
|
||||||
|
|
||||||
== Testing the Server ==
|
== Testing the Server ==
|
||||||
|
|
||||||
The easiest way to test the server is to open a Maniphest Task or Differential
|
The easiest way to test the server is to have two users login and comment on
|
||||||
Revision in two browser windows at the same time, then comment on it with one.
|
the same Maniphest Task or Differential Revision. They should receive in-browser
|
||||||
You should get a notification in the other window.
|
notifications about the other user's activity.
|
||||||
|
|
||||||
NOTE: This will stop working soon, since we'll soon stop delivering
|
NOTE: This is cumbersome. There will be better testing tools at some point.
|
||||||
notifications about your own actions. We'll provide an alternate way to test
|
|
||||||
operation when this stops working.
|
|
||||||
|
|
||||||
== Debugging Server Problems ==
|
== Debugging Server Problems ==
|
||||||
|
|
||||||
|
|
|
@ -323,8 +323,7 @@ final class PhabricatorStandardPageView extends PhabricatorBarePageView {
|
||||||
$user = $request->getUser();
|
$user = $request->getUser();
|
||||||
|
|
||||||
$container = null;
|
$container = null;
|
||||||
if (PhabricatorEnv::getEnvConfig('notification.enabled') &&
|
if ($user->isLoggedIn()) {
|
||||||
$user->isLoggedIn()) {
|
|
||||||
|
|
||||||
$aphlict_object_id = celerity_generate_unique_node_id();
|
$aphlict_object_id = celerity_generate_unique_node_id();
|
||||||
$aphlict_container_id = celerity_generate_unique_node_id();
|
$aphlict_container_id = celerity_generate_unique_node_id();
|
||||||
|
|
|
@ -52,8 +52,7 @@ final class PhabricatorMainMenuView extends AphrontView {
|
||||||
$menus = array();
|
$menus = array();
|
||||||
$alerts = array();
|
$alerts = array();
|
||||||
|
|
||||||
if (PhabricatorEnv::getEnvConfig('notification.enabled') &&
|
if ($user->isLoggedIn()) {
|
||||||
$user->isLoggedIn()) {
|
|
||||||
list($menu, $dropdown) = $this->renderNotificationMenu();
|
list($menu, $dropdown) = $this->renderNotificationMenu();
|
||||||
$alerts[] = $menu;
|
$alerts[] = $menu;
|
||||||
$menus[] = $dropdown;
|
$menus[] = $dropdown;
|
||||||
|
|
Loading…
Reference in a new issue