Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F18681263
D12092.id29089.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
5 KB
Referenced Files
None
Subscribers
None
D12092.id29089.diff
View Options
diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -352,7 +352,7 @@
'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' => 'cff1902b',
+ 'rsrc/js/application/conpherence/ConpherenceThreadManager.js' => '1729cc24',
'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 @@
'conpherence-menu-css' => 'c6ac5299',
'conpherence-message-pane-css' => '2526107d',
'conpherence-notification-css' => '04a6e10a',
- 'conpherence-thread-manager' => 'cff1902b',
+ 'conpherence-thread-manager' => '1729cc24',
'conpherence-update-css' => '1099a660',
'conpherence-widget-pane-css' => '3d575438',
'differential-changeset-view-css' => '6a8b172a',
@@ -933,6 +933,16 @@
'javelin-request',
'javelin-util',
),
+ '1729cc24' => array(
+ 'javelin-dom',
+ 'javelin-util',
+ 'javelin-stratcom',
+ 'javelin-install',
+ 'javelin-workflow',
+ 'javelin-router',
+ 'javelin-behavior-device',
+ 'javelin-vector',
+ ),
'1ad0a787' => array(
'javelin-install',
'javelin-reactor',
@@ -1764,16 +1774,6 @@
'javelin-stratcom',
'phabricator-phtize',
),
- 'cff1902b' => array(
- 'javelin-dom',
- 'javelin-util',
- 'javelin-stratcom',
- 'javelin-install',
- 'javelin-workflow',
- 'javelin-router',
- 'javelin-behavior-device',
- 'javelin-vector',
- ),
'd19198c8' => array(
'javelin-install',
'javelin-dom',
diff --git a/src/applications/conpherence/controller/ConpherenceViewController.php b/src/applications/conpherence/controller/ConpherenceViewController.php
--- a/src/applications/conpherence/controller/ConpherenceViewController.php
+++ b/src/applications/conpherence/controller/ConpherenceViewController.php
@@ -58,6 +58,9 @@
$content['title'] = $title;
if ($request->isAjax()) {
+ $content['threadID'] = $conpherence->getID();
+ $content['threadPHID'] = $conpherence->getPHID();
+ $content['latestTransactionID'] = $data['latest_transaction_id'];
return id(new AphrontAjaxResponse())->setContent($content);
}
diff --git a/webroot/rsrc/js/application/conpherence/ConpherenceThreadManager.js b/webroot/rsrc/js/application/conpherence/ConpherenceThreadManager.js
--- a/webroot/rsrc/js/application/conpherence/ConpherenceThreadManager.js
+++ b/webroot/rsrc/js/application/conpherence/ConpherenceThreadManager.js
@@ -177,7 +177,16 @@
var workflow = new JX.Workflow(uri)
.setData(params)
.setHandler(JX.bind(this, function(r) {
+ if (this._updating &&
+ this._updating.threadPHID == this._loadedThreadPHID) {
+ // we have a different, more current update in progress so
+ // return early
+ if (r.latest_transaction_id < this._updating.knownID) {
+ return;
+ }
+ }
this._latestTransactionID = r.latest_transaction_id;
+ this._updating.knownID = r.latest_transaction_id;
this._didUpdateThreadCallback(r);
}));
@@ -191,10 +200,10 @@
};
workflow.listen(stage, JX.bind(this, function() {
// TODO - do we need to handle if we switch threads somehow?
- var need_sync = (this._updating.knownID > this._latestTransactionID);
- this._updating = null;
+ var need_sync = this._updating &&
+ (this._updating.knownID > this._latestTransactionID);
if (need_sync) {
- this._updateThread();
+ return this._updateThread();
}
}));
workflow.start();
@@ -206,6 +215,19 @@
var workflow = new JX.Workflow.newFromLink(link)
.setData(params)
.setHandler(JX.bind(this, function(r) {
+ if (this._updating &&
+ this._updating.threadPHID == this._loadedThreadPHID) {
+ // we have a different, more current update in progress so
+ // return early
+ if (r.latest_transaction_id < this._updating.knownID) {
+ return;
+ }
+ // we need to let the update code handle things here
+ if (r.latest_transaction_id > this._updating.knownID) {
+ this._updating.knownID = r.latest_transaction_id;
+ return;
+ }
+ }
this._latestTransactionID = r.latest_transaction_id;
this._didUpdateWorkflowCallback(r);
}));
@@ -249,6 +271,19 @@
var workflow = JX.Workflow.newFromForm(form, params, keep_enabled)
.setHandler(JX.bind(this, function(r) {
+ if (this._updating &&
+ this._updating.threadPHID == this._loadedThreadPHID) {
+ // we have a different, more current update in progress so
+ // return early
+ if (r.latest_transaction_id < this._updating.knownID) {
+ return;
+ }
+ // we need to let the update code handle things here
+ if (r.latest_transaction_id > this._updating.knownID) {
+ this._updating.knownID = r.latest_transaction_id;
+ return;
+ }
+ }
this._latestTransactionID = r.latest_transaction_id;
this._didSendMessageCallback(r);
}));
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sep 27 2025, 4:00 AM (5 w, 19 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
9155552
Default Alt Text
D12092.id29089.diff (5 KB)
Attached To
Mode
D12092: Conpherence - kill race conditions around update
Attached
Detach File
Event Timeline
Log In to Comment