1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-26 00:32:42 +01:00

Resolve deleted packages properly as having no mailable members

Summary:
Fixes T13648. If a package recipient has been destroyed, this query currently fails to return an expanded recipient value.

Instead, make sure all input PHIDs get an output. For destroyed packages, the output will just be an empty list.

Test Plan:
  - Added a package to a revision as a reviewer.
  - Destroyed the package.
  - Commented on the revision.
  - Processed the publishing worker with `bin/worker execute`.
  - Before: fatal after expanding the destroyed package.
  - After: clean publish.

Maniphest Tasks: T13648

Differential Revision: https://secure.phabricator.com/D21707
This commit is contained in:
epriestley 2021-07-21 14:20:32 -07:00
parent 4cffaa600b
commit 387d3b4983

View file

@ -60,6 +60,16 @@ final class PhabricatorMetaMTAMemberQuery extends PhabricatorQuery {
}
$package_map[$package->getPHID()] = $package_owners;
}
// See T13648. We may have packages that no longer exist or can't be
// loaded (for example, because they have been destroyed). Give them
// empty entries in the map so we return a mapping for all input PHIDs.
foreach ($package_phids as $package_phid) {
if (!isset($package_map[$package_phid])) {
$package_map[$package_phid] = array();
}
}
}
$results = array();