Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15665031
D8166.id18476.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D8166.id18476.diff
View Options
diff --git a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
--- a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
+++ b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
@@ -208,6 +208,38 @@
case PhabricatorTransactions::TYPE_CUSTOMFIELD:
$field = $this->getCustomFieldForTransaction($object, $xaction);
return $field->getApplicationTransactionHasEffect($xaction);
+ case PhabricatorTransactions::TYPE_EDGE:
+ // A straight value comparison here doesn't always get the right
+ // result, because newly added edges aren't fully populated. Instead,
+ // compare the changes in a more granular way.
+ $old = $xaction->getOldValue();
+ $new = $xaction->getNewValue();
+
+ $old_dst = array_keys($old);
+ $new_dst = array_keys($new);
+
+ // NOTE: For now, we don't consider edge reordering to be a change.
+ // We have very few order-dependent edges and effectively no order
+ // oriented UI. This might change in the future.
+ sort($old_dst);
+ sort($new_dst);
+
+ if ($old_dst !== $new_dst) {
+ // We've added or removed edges, so this transaction definitely
+ // has an effect.
+ return true;
+ }
+
+ // We haven't added or removed edges, but we might have changed
+ // edge data.
+ foreach ($old as $key => $old_value) {
+ $new_value = $new[$key];
+ if ($old_value['data'] !== $new_value['data']) {
+ return true;
+ }
+ }
+
+ return false;
}
return ($xaction->getOldValue() !== $xaction->getNewValue());
@@ -1011,7 +1043,7 @@
}
if (!isset($edge['data'])) {
- $edge['data'] = null;
+ $edge['data'] = array();
}
return $edge;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, May 26, 3:43 AM (19 h, 9 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
8026268
Default Alt Text
D8166.id18476.diff (1 KB)
Attached To
Mode
D8166: Improve detection of no-op edge edits in ApplicationTransactions
Attached
Detach File
Event Timeline
Log In to Comment