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:
@@ -452,6 +452,9 @@ final class DifferentialCommentEditor {
|
|||||||
$revision->setLastReviewerPHID($actor_phid);
|
$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
|
// 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
|
// 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
|
// 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);
|
$phids = array($this->actorPHID);
|
||||||
$handles = id(new PhabricatorObjectHandleData($phids))
|
$handles = id(new PhabricatorObjectHandleData($phids))
|
||||||
->loadHandles();
|
->loadHandles();
|
||||||
|
|||||||
Reference in New Issue
Block a user