Homec4science

Multiplex AJAX calls

Authored by Joshua Spence <josh@joshuaspence.com> on Jan 15 2015, 21:05.

Description

Multiplex AJAX calls

Summary: Fixes T5344. Essentially, we only make the AJAX request to /notification/individual/ if we are the leader tab (i.e. only one tab will make this request). Once a response has been received from the server (containing the contents of the notification), we broadcast the message contents back to all other tabs for rendering.

Test Plan:
Opened two tabs on /notification/status/ and clicked "Send Test Notification".

Before

tail -f /var/log/phabricator-access.log | grep /notification/individual/
[Tue, 13 Jan 2015 20:10:37 +1100]   17033   phabricator 10.0.0.1    josh    PhabricatorNotificationIndividualController -   /notification/individual/-200   236036
[Tue, 13 Jan 2015 20:10:37 +1100]   17657   phabricator 10.0.0.1    josh    PhabricatorNotificationIndividualController -   /notification/individual/-200   24130

After

tail -f /var/log/phabricator-access.log | grep /notification/individual/
[Tue, 13 Jan 2015 20:11:15 +1100]   17657   phabricator 10.0.0.1    josh    PhabricatorNotificationIndividualController -   /notification/individual/-200   180217

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T5344

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

Details

Committed
Joshua Spence <josh@joshuaspence.com>Jan 15 2015, 21:05
Pushed
aubortJan 31 2017, 17:16
Parents
rPH62dfcd1e552f: Fix the visibility of `PhutilDaemon::run` methods
Branches
Unknown
Tags
Unknown

Event Timeline

Joshua Spence <josh@joshuaspence.com> committed rPH4135752490b8: Multiplex AJAX calls (authored by Joshua Spence <josh@joshuaspence.com>).Jan 15 2015, 21:05