@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 a case where "Accept + Comment" would ignore the "Accept"

Summary:
Ref T11114. When you comment, we try to upgrade your review status to "commented".

This can conflict with upgrading it to "accepted" or "rejected", or removing it entirely.

For now, just avoid making this update. After T10967, I expect "you commented" to be orthogonal to accepted/rejected so it should stop conflicting on its own.

Test Plan:
- As an "added" reviewer, accepted a revision with a comment in the same transaction.
- Before patch: accept didn't stick.
- After patch: accept sticks.

This may be somewhat magical/order-dependent but I was able to reproduce it locally.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11114

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

+15 -2
+15 -2
src/applications/differential/editor/DifferentialTransactionEditor.php
··· 7 7 private $isCloseByCommit; 8 8 private $repositoryPHIDOverride = false; 9 9 private $didExpandInlineState = false; 10 + private $hasReviewTransaction = false; 10 11 private $affectedPaths; 11 12 12 13 public function getEditorApplicationClass() { ··· 261 262 PhabricatorLiskDAO $object, 262 263 array $xactions) { 263 264 264 - // If we have an "Inline State" transaction already, the caller built it 265 - // for us so we don't need to expand it again. 266 265 foreach ($xactions as $xaction) { 267 266 switch ($xaction->getTransactionType()) { 268 267 case PhabricatorTransactions::TYPE_INLINESTATE: 268 + // If we have an "Inline State" transaction already, the caller 269 + // built it for us so we don't need to expand it again. 269 270 $this->didExpandInlineState = true; 271 + break; 272 + case DifferentialRevisionAcceptTransaction::TRANSACTIONTYPE: 273 + case DifferentialRevisionRejectTransaction::TRANSACTIONTYPE: 274 + case DifferentialRevisionResignTransaction::TRANSACTIONTYPE: 275 + // If we have a review transaction, we'll skip marking the user 276 + // as "Commented" later. This should get cleaner after T10967. 277 + $this->hasReviewTransaction = true; 270 278 break; 271 279 } 272 280 } ··· 425 433 // When a user leaves a comment, upgrade their reviewer status from 426 434 // "added" to "commented" if they're also a reviewer. We may further 427 435 // upgrade this based on other actions in the transaction group. 436 + 437 + if ($this->hasReviewTransaction) { 438 + // If we're also applying a review transaction, skip this. 439 + break; 440 + } 428 441 429 442 $status_added = DifferentialReviewerStatus::STATUS_ADDED; 430 443 $status_commented = DifferentialReviewerStatus::STATUS_COMMENTED;