Page MenuHomePhabricator

Straighten out addTextSection() / addRemarkupSection() in mail body construction
Open, NormalPublic

Description

  • addTextSection() activates a secret mode when passed an existing section object. It should not accept a section object.
  • Inline comments are not remarkup or text sections.
  • This API is generally bewildering.

Event Timeline

epriestley raised the priority of this task from to Normal.
epriestley updated the task description. (Show Details)
epriestley added subscribers: epriestley, nickz.

Nothing every goes wrong with lots of options!

Yeah, I'd really like to just get rid of this option. It's definitely not something we'd accept upstream today.

I just saw this happen on this install (no metamta.differential.unified-comment-context) so my guess was probably incorrect.

This is likely the next cause up the line:

Daemon 123093 STDE [Sat, 28 Nov 2015 20:00:59 +0000] [2015-11-28 20:00:58] ERROR 2: strlen() expects parameter 1 to be string, object given at [/core/lib/libphutil/src/utils/utils.php:769]
Daemon 123093 STDE [Sat, 28 Nov 2015 20:00:59 +0000] arcanist(head=master, ref.master=4f1141d0c59b), phabricator(head=master, ref.master=eb62a98e0fc7), phutil(head=master, ref.master=f0881b37049c)
Daemon 123093 STDE [Sat, 28 Nov 2015 20:00:59 +0000]   #0 strlen(PhabricatorMetaMTAMailSection) called at [<phutil>/src/utils/utils.php:769]
Daemon 123093 STDE [Sat, 28 Nov 2015 20:00:59 +0000]   #1 phutil_split_lines(PhabricatorMetaMTAMailSection, boolean) called at [<phutil>/src/markup/engine/PhutilRemarkupEngine.php:148]
Daemon 123093 STDE [Sat, 28 Nov 2015 20:00:59 +0000]   #2 PhutilRemarkupEngine::splitTextIntoBlocks(PhabricatorMetaMTAMailSection) called at [<phutil>/src/markup/engine/PhutilRemarkupEngine.php:124]
Daemon 123093 STDE [Sat, 28 Nov 2015 20:00:59 +0000]   #3 PhutilRemarkupEngine::preprocessText(PhabricatorMetaMTAMailSection) called at [<phutil>/src/markup/engine/PhutilRemarkupEngine.php:94]
Daemon 123093 STDE [Sat, 28 Nov 2015 20:00:59 +0000]   #4 PhutilRemarkupEngine::markupText(PhabricatorMetaMTAMailSection) called at [<phabricator>/src/applications/metamta/view/PhabricatorMetaMTAMailBody.php:51]
Daemon 123093 STDE [Sat, 28 Nov 2015 20:00:59 +0000]   #5 PhabricatorMetaMTAMailBody::addRemarkupSection(string, PhabricatorMetaMTAMailSection) called at [<phabricator>/src/applications/differential/editor/DifferentialTransactionEditor.php:1217]
Daemon 123093 STDE [Sat, 28 Nov 2015 20:00:59 +0000]   #6 DifferentialTransactionEditor::buildMailBody(DifferentialRevision, array) called at [<phabricator>/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:2376]
Daemon 123093 STDE [Sat, 28 Nov 2015 20:00:59 +0000]   #7 PhabricatorApplicationTransactionEditor::buildMailForTarget(DifferentialRevision, array, PhabricatorMailTarget) called at [<phabricator>/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:2333]
Daemon 123093 STDE [Sat, 28 Nov 2015 20:00:59 +0000]   #8 PhabricatorApplicationTransactionEditor::buildMail(DifferentialRevision, array) called at [<phabricator>/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:1048]
Daemon 123093 STDE [Sat, 28 Nov 2015 20:00:59 +0000]   #9 PhabricatorApplicationTransactionEditor::publishTransactions(DifferentialRevision, array) called at [<phabricator>/src/applications/transactions/worker/PhabricatorApplicationTransactionPublishWorker.php:21]
Daemon 123093 STDE [Sat, 28 Nov 2015 20:00:59 +0000]   #10 PhabricatorApplicationTransactionPublishWorker::doWork() called at [<phabricator>/src/infrastructure/daemon/workers/PhabricatorWorker.php:122]
Daemon 123093 STDE [Sat, 28 Nov 2015 20:00:59 +0000]   #11 PhabricatorWorker::executeTask() called at [<phabricator>/src/infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php:171]
Daemon 123093 STDE [Sat, 28 Nov 2015 20:00:59 +0000]   #12 PhabricatorWorkerActiveTask::executeTask() called at [<phabricator>/src/infrastructure/daemon/workers/PhabricatorTaskmasterDaemon.php:22]
Daemon 123093 STDE [Sat, 28 Nov 2015 20:00:59 +0000]   #13 PhabricatorTaskmasterDaemon::run() called at [<phutil>/src/daemon/PhutilDaemon.php:183]
Daemon 123093 STDE [Sat, 28 Nov 2015 20:00:59 +0000]   #14 PhutilDaemon::execute() called at [<phutil>/scripts/daemon/exec/exec_daemon.php:125]

I think this is just junked up and I hadn't pushed this server when I claimed it works.

Context here is:

  • D9375 added some really sketchy behavior to addTextSection() which I missed in review.
  • D13554 added addRemarkupSection().
  • D14511 swapped from addTextSection() to addRemarkupSection().

The object is not a remarkup section, nor is it a text section.

I'm going to fix this narrowly for now and repurpose this task for finding a broader fix.

epriestley renamed this task from `metamta.differential.unified-comment-context` not working at HEAD? to Straighten out addTextSection() / addRemarkupSection() in mail body construction.Nov 28 2015, 9:42 PM
epriestley updated the task description. (Show Details)

D14589 should fix the immediate issue. I've also cherry-picked it into stable.

There's more cleanup be done here but that can wait for another day.

This one is totally my bad.
My intention was to make it less spooky to migrate individual pieces to the section construct (since the API remained largely the same), but the API weirdness was not worth it, and didn't even achieve that goal

epriestley added a subscriber: cspeckmim.

From T10170, Ponder still has some addRawSection() calls which should be addRemarkupSection() calls.