From da8ffbac1221d4d45ebfbba32f4778d2012fb183 Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 12 Aug 2013 11:20:30 -0700 Subject: [PATCH] Don't synchronize Asana objects with no CCs and no responsible, non-author users Summary: Ref T2852. Currently, we publish commits with no audit requests and reviews with no CCs or reviewers into Asana. This creates undesired notifications, so drop events which would publish an object that doesn't exist yet and has no followers or respible users. Test Plan: Used `bin/feed republish` to publish a story about an object with no related users, saw the publish abort with the new message. Added a CC, published again, got a publish. Reviewers: btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T2852 Differential Revision: https://secure.phabricator.com/D6727 --- .../doorkeeper/worker/DoorkeeperFeedWorkerAsana.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/applications/doorkeeper/worker/DoorkeeperFeedWorkerAsana.php b/src/applications/doorkeeper/worker/DoorkeeperFeedWorkerAsana.php index 49166b43a8..660c554cae 100644 --- a/src/applications/doorkeeper/worker/DoorkeeperFeedWorkerAsana.php +++ b/src/applications/doorkeeper/worker/DoorkeeperFeedWorkerAsana.php @@ -283,6 +283,14 @@ final class DoorkeeperFeedWorkerAsana extends FeedPushWorker { } } } else { + // If there are no followers (CCs), and no active or passive users + // (reviewers or auditors), and we haven't synchronized the object before, + // don't synchronize the object. + if (!$active_phids && !$passive_phids && !$follow_phids) { + $this->log("Object has no followers or active/passive users.\n"); + return; + } + $parent = $this->makeAsanaAPICall( $oauth_token, 'tasks',