{"record":{"id":"46ca96d83fa738ec","repo":"phacility/phabricator","slug":"you-can-not-accept-this-commit-because-you-have-al","errorCode":null,"errorMessage":"You can not accept this commit because you have already accepted it.","messagePattern":"You can not accept this commit because you have already accepted it\\.","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"warning","filePath":"src/applications/diffusion/xaction/DiffusionCommitAcceptTransaction.php","lineNumber":53,"sourceCode":"    $actor = $this->getActor();\n    $this->applyAuditorEffect($object, $actor, $value, $status);\n  }\n\n  protected function validateAction($object, PhabricatorUser $viewer) {\n    $config_key = 'audit.can-author-close-audit';\n    if (!PhabricatorEnv::getEnvConfig($config_key)) {\n      if ($this->isViewerCommitAuthor($object, $viewer)) {\n        throw new Exception(\n          pht(\n            'You can not accept this commit because you are the commit '.\n            'author. You can only accept commits you did not author. You can '.\n            'change this behavior by adjusting the \"%s\" setting in Config.',\n            $config_key));\n      }\n    }\n\n    if ($this->isViewerFullyAccepted($object, $viewer)) {\n      throw new Exception(\n        pht(\n          'You can not accept this commit because you have already '.\n          'accepted it.'));\n    }\n  }\n\n  public function getTitle() {\n    return pht(\n      '%s accepted this commit.',\n      $this->renderAuthor());\n  }\n\n  public function getTitleForFeed() {\n    return pht(\n      '%s accepted %s.',\n      $this->renderAuthor(),\n      $this->renderObject());\n  }","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/diffusion/xaction/DiffusionCommitAcceptTransaction.php#L35-L71","documentation":"The second guard in Accept's validateAction(): isViewerFullyAccepted() reports the viewer already accepted every audit request they hold on the commit, so accepting again is a no-op that the application rejects rather than recording a duplicate transaction.","triggerScenarios":"Clicking Accept Commit twice; retrying an audit action after a UI delay that already applied it; scripts that re-apply accept on every run.","commonSituations":"Double-clicks and stale browser tabs; idempotency-naive automation; users unsure whether the first click registered.","solutions":["No action needed - the accept is already recorded; refresh the commit page to confirm","Make automation check current audit state before applying transactions","If re-review is genuinely wanted, the flow must reset: concerns and Request Verification reopen the audit cycle"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if ($xaction->isViewerFullyAccepted($object, $viewer)) {\n  return; // already accepted; skip applying the transaction\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Make audit automation idempotent: read current audit state before writing","Disable action buttons for states where they would throw instead of relying on server-side rejection"],"tags":["phabricator","audit","diffusion","duplicate-action","state-machine"],"backgroundTag":"invalid-state-transition","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}