@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix two problems with actor order in Asana bridge

Summary: We attempt to choose the most reasonable actor when synchronizing to Asana, but Asana is seeing the sync choose a less-reasonable actor. I spotted two places where the order may get disrupted; make sure we retain order. This is somewhat tricky to repro locally (it depends on things like native account order) but I think this is the right fix. If not, I'll add more logging. Ref T2852.

Test Plan: Used `bin/feed republish` to sync Asana events.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2852

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

+12 -2
+12 -2
src/applications/doorkeeper/worker/DoorkeeperFeedWorkerAsana.php
··· 163 163 $object = $this->getStoryObject(); 164 164 $src_phid = $object->getPHID(); 165 165 166 + $chronological_key = $story->getChronologicalKey(); 167 + 166 168 if (!$this->isObjectSupported($object)) { 167 169 $this->log("Story is about an unsupported object type.\n"); 168 170 return; ··· 189 191 $follow_phids); 190 192 $all_follow_phids = array_unique(array_filter($all_follow_phids)); 191 193 192 - $all_phids = $all_follow_phids; 193 - $all_phids[] = $owner_phid; 194 + $all_phids = array(); 195 + $all_phids = array_merge( 196 + array($owner_phid), 197 + $all_follow_phids); 194 198 $all_phids = array_unique(array_filter($all_phids)); 195 199 196 200 $phid_aid_map = $this->lookupAsanaUserIDs($all_phids); ··· 536 540 ->withAccountTypes(array($provider->getProviderType())) 537 541 ->withAccountDomains(array($provider->getProviderDomain())) 538 542 ->execute(); 543 + 544 + // Reorder accounts in the original order. 545 + // TODO: This needs to be adjusted if/when we allow you to link multiple 546 + // accounts. 547 + $accounts = mpull($accounts, null, 'getUserPHID'); 548 + $accounts = array_select_keys($accounts, $user_phids); 539 549 540 550 $workspace_id = $this->getWorkspaceID(); 541 551