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

Use transactions in saving comment

Summary: We had a real issue where revision was marked as accepted but the comment wasn't saved.

Test Plan: Reclaim abandoned revision.

Reviewers: epriestley

Reviewed By: epriestley

CC: jungejason, aran, Koolvin

Differential Revision: https://secure.phabricator.com/D2463
This commit is contained in:
vrana 2012-05-11 16:36:08 -07:00
parent 820a6d407a
commit d85425e654

View file

@ -452,6 +452,9 @@ final class DifferentialCommentEditor {
$revision->setLastReviewerPHID($actor_phid);
}
// TODO: Call beginReadLocking() prior to loading the revision.
$revision->openTransaction();
// Always save the revision (even if we didn't actually change any of its
// properties) so that it jumps to the top of the revision list when sorted
// by "updated". Notably, this allows "ping" comments to push it to the
@ -522,6 +525,8 @@ final class DifferentialCommentEditor {
}
}
$revision->saveTransaction();
$phids = array($this->actorPHID);
$handles = id(new PhabricatorObjectHandleData($phids))
->loadHandles();