From 708acce9275ac95a579868ca61dd2a66766019c3 Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 13 Feb 2018 17:53:36 -0800 Subject: [PATCH] (stable) Fix a mail stamp issue with blocking reviewers Summary: Revisions with blocking reviewers had this stamp built incorrectly, which cascaded into trying to use `array()` as a PHID. Recover so these tasks succeed. Test Plan: Will deploy production. Differential Revision: https://secure.phabricator.com/D19082 --- .../engineextension/DifferentialMailEngineExtension.php | 2 +- .../metamta/stamp/PhabricatorPHIDMailStamp.php | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/applications/differential/engineextension/DifferentialMailEngineExtension.php b/src/applications/differential/engineextension/DifferentialMailEngineExtension.php index 24aa9fb329..29019b9e73 100644 --- a/src/applications/differential/engineextension/DifferentialMailEngineExtension.php +++ b/src/applications/differential/engineextension/DifferentialMailEngineExtension.php @@ -53,7 +53,7 @@ final class DifferentialMailEngineExtension } else { $reviewers[] = $reviewer_phid; if ($reviewer->isBlocking()) { - $reviewers[] = $blocking; + $blocking[] = $reviewer_phid; } } } diff --git a/src/applications/metamta/stamp/PhabricatorPHIDMailStamp.php b/src/applications/metamta/stamp/PhabricatorPHIDMailStamp.php index 575ad16f6a..ea7233fe5b 100644 --- a/src/applications/metamta/stamp/PhabricatorPHIDMailStamp.php +++ b/src/applications/metamta/stamp/PhabricatorPHIDMailStamp.php @@ -15,6 +15,15 @@ final class PhabricatorPHIDMailStamp return null; } + // TODO: This recovers from a bug where blocking reviewers were serialized + // incorrectly into the flat mail stamp list in the worker queue as arrays. + // It can be removed some time after February 2018. + foreach ($value as $key => $v) { + if (is_array($v)) { + unset($value[$key]); + } + } + $viewer = $this->getViewer(); $handles = $viewer->loadHandles($value);