Page MenuHomePhorge

Bugs in 2022 Week 21 Stable
Closed, ResolvedPublic

Description

I'm sticking this here because I don't have a better place for it; the upstream 2022 Week 21 Stable release from day has a bunch of bugs in my testing:

Viewing diffs with open comments from the previous release fails with

Argument 1 passed to PhabricatorRemarkupControl::setRemarkupMetadata() must be of the type array, null given, called in /srv/_versions/phabricator/phabricator-202205272304-5f812a2afc-master/phabricator/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php on line 328

I worked around this with

diff --git a/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php b/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php
index caf1ce5183..d8057e7edd 100644
--- a/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php
+++ b/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php
@@ -325,7 +325,9 @@ final class PhabricatorApplicationTransactionCommentView
     }

     $remarkup_control->setValue($draft_comment);
-    $remarkup_control->setRemarkupMetadata($draft_metadata);
+    if ($draft_metadata !== null) {
+      $remarkup_control->setRemarkupMetadata($draft_metadata);
+    }

     if (!$this->getObjectPHID()) {
       throw new PhutilInvalidStateException('setObjectPHID', 'render');

Similarly, posting comments to diffs fails with

[Fri May 27 23:48:10 2022] [notice] [2022-05-27 16:48:10] EXCEPTION: (TypeError) Argument 1 passed to PhabricatorTransactionChange::setMetadata() must be of the type array, null given, called in /srv/_versions/phabricator/phabricator-202205272338-cf62252f51-master/phabricator/src/applications/transactions/storage/PhabricatorApplicationTransaction.php on line 250 at [<phabricator>/src/applications/transactions/data/PhabricatorTransactionChange.php:38]
[Fri May 27 23:48:10 2022] [notice] arcanist(), phabricator(custom=9)
[Fri May 27 23:48:10 2022] [notice]   #0 phlog(TypeError) called at [<phabricator>/src/aphront/handler/PhabricatorAjaxRequestExceptionHandler.php:27]
[Fri May 27 23:48:10 2022] [notice]   #1 PhabricatorAjaxRequestExceptionHandler::handleRequestThrowable(AphrontRequest, TypeError) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:751]
[Fri May 27 23:48:10 2022] [notice]   #2 AphrontApplicationConfiguration::handleThrowable(TypeError) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:296]
[Fri May 27 23:48:10 2022] [notice]   #3 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:204]
[Fri May 27 23:48:10 2022] [notice]   #4 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phabricator>/webroot/index.php:35]

I worked around this with

diff --git a/src/applications/transactions/storage/PhabricatorApplicationTransaction.php b/src/applications/transactions/storage/PhabricatorApplicationTransaction.php
index 51ed2adba8..9a21defa88 100644
--- a/src/applications/transactions/storage/PhabricatorApplicationTransaction.php
+++ b/src/applications/transactions/storage/PhabricatorApplicationTransaction.php
@@ -246,7 +246,7 @@ abstract class PhabricatorApplicationTransaction

     $metadata = $this->getMetadataValue('remarkup.control', array());
     foreach ($changes as $change) {
-      if (!$change->getMetadata()) {
+      if (!$change->getMetadata() && ($metadata !== null)) {
         $change->setMetadata($metadata);
       }
     }

I'm not aware of any way to communicate with upstream but we may need to apply similar patches when we merge in the latest changes (or, alternatively, do more research to figure out why these things are failing).