{"record":{"id":"97e7f30341df529e","repo":"phacility/phabricator","slug":"invalid-revision-id-s","errorCode":null,"errorMessage":"Invalid revision ID \"%s\".","messagePattern":"Invalid revision ID \"(.+?)\"\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/differential/controller/DifferentialInlineCommentEditController.php","lineNumber":27,"sourceCode":"\n  protected function newContainerObject() {\n    return $this->loadRevision();\n  }\n\n  private function getRevisionID() {\n    return $this->getRequest()->getURIData('id');\n  }\n\n  private function loadRevision() {\n    $viewer = $this->getViewer();\n    $revision_id = $this->getRevisionID();\n\n    $revision = id(new DifferentialRevisionQuery())\n      ->setViewer($viewer)\n      ->withIDs(array($revision_id))\n      ->executeOne();\n   if (!$revision) {\n      throw new Exception(pht('Invalid revision ID \"%s\".', $revision_id));\n    }\n\n    return $revision;\n  }\n\n  protected function createComment() {\n    // Verify revision and changeset correspond to actual objects, and are\n    // connected to one another.\n    $changeset_id = $this->getChangesetID();\n    $viewer = $this->getViewer();\n\n    $revision = $this->loadRevision();\n\n    $changeset = id(new DifferentialChangesetQuery())\n      ->setViewer($viewer)\n      ->withIDs(array($changeset_id))\n      ->executeOne();\n    if (!$changeset) {","sourceCodeStart":9,"sourceCodeEnd":45,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/differential/controller/DifferentialInlineCommentEditController.php#L9-L45","documentation":"The inline-comment edit controller resolves the revision from the request's revision id. If the policy-filtered query returns no revision, it throws 'Invalid revision ID'. This is a request-construction problem: the ID never identified a visible revision at request time.","triggerScenarios":"Submitting an inline comment create/edit/done request whose revision id is nonexistent or invisible; stale pages kept open after a revision was deleted; hand-modified URIs or replayed requests.","commonSituations":"Long-lived browser tabs after revisions were removed; browser extensions or custom front-ends that post to the inline-comment endpoints with stale IDs.","solutions":["Reload the revision page so the form and URI carry fresh, correct IDs.","Verify the revision still exists and is visible to your account.","Do not hand-edit inline comment URIs or replay captured requests."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  // dispatch the inline comment edit request (controller/custom flow)\n} catch (Exception $ex) {\n  if (preg_match('/Invalid revision ID/', $ex->getMessage())) {\n    // stale request: re-fetch the revision URI and retry once with fresh ids\n  } else {\n    throw $ex;\n  }\n}","preventionTips":["Reload the revision page after errors instead of resubmitting.","Never hand-edit inline comment URIs.","In extensions, resolve the revision with the acting viewer before dispatching inline edits."],"tags":["phabricator","differential","inline-comment","controller"],"backgroundTag":"resource-not-found","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}