Skip to content

Commit 091beee

Browse files
author
epriestley
committed
Don't publish Differential "create" action to Asana
Summary: Ref T2852. Currently there's effectively a double notification: one for creating the task, and one for the "alincoln created this revision" story. Drop the "create" story. Test Plan: Used `bin/feed republish` to republish "create" and non-"create" stories. Verified "create" was dropped as unsupported, while non-"create" went through. Reviewers: btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T2852 Differential Revision: https://secure.phabricator.com/D6589
1 parent a7e4b84 commit 091beee

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

src/applications/differential/doorkeeper/DifferentialDoorkeeperRevisionFeedStoryPublisher.php

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,23 @@ final class DifferentialDoorkeeperRevisionFeedStoryPublisher
44
extends DoorkeeperFeedStoryPublisher {
55

66
public function canPublishStory(PhabricatorFeedStory $story, $object) {
7-
return ($object instanceof DifferentialRevision);
7+
if (!($object instanceof DifferentialRevision)) {
8+
return false;
9+
}
10+
11+
// Don't publish the "create" story, since pushing the object into Asana
12+
// naturally generates a notification which effectively serves the same
13+
// purpose as the "create" story.
14+
15+
$action = $story->getStoryData()->getValue('action');
16+
switch ($action) {
17+
case DifferentialAction::ACTION_CREATE:
18+
return false;
19+
default:
20+
break;
21+
}
22+
23+
return true;
824
}
925

1026
public function willPublishStory($object) {

0 commit comments

Comments
 (0)