{"record":{"id":"137ccd9510d9fc10","repo":"phacility/phabricator","slug":"unable-to-load-revision","errorCode":null,"errorMessage":"Unable to load revision.","messagePattern":"Unable to load revision\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/differential/controller/DifferentialInlineCommentEditController.php","lineNumber":98,"sourceCode":"      ->executeOne();\n    if (!$changeset) {\n      throw new Exception(pht('Unable to load changeset.'));\n    }\n\n    $diff = id(new DifferentialDiffQuery())\n      ->setViewer($viewer)\n      ->withIDs(array($changeset->getDiffID()))\n      ->executeOne();\n    if (!$diff) {\n      throw new Exception(pht('Unable to load diff.'));\n    }\n\n    $revision = id(new DifferentialRevisionQuery())\n      ->setViewer($viewer)\n      ->withIDs(array($diff->getRevisionID()))\n      ->executeOne();\n    if (!$revision) {\n      throw new Exception(pht('Unable to load revision.'));\n    }\n\n    $viewer_phid = $viewer->getPHID();\n    $is_owner = ($viewer_phid == $revision->getAuthorPHID());\n    $is_author = ($viewer_phid == $inline->getAuthorPHID());\n    $is_draft = ($inline->isDraft());\n\n    if ($is_owner) {\n      // You own the revision, so you can mark the comment as \"Done\".\n    } else if ($is_author && $is_draft) {\n      // You made this comment and it's still a draft, so you can mark\n      // it as \"Done\".\n    } else {\n      throw new Exception(\n        pht(\n          'You are not the revision owner, and this is not a draft comment '.\n          'you authored.'));\n    }","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/differential/controller/DifferentialInlineCommentEditController.php#L80-L116","documentation":"The final hop of the 'Done' flow loads the revision that owns the diff; failure throws 'Unable to load revision'. Either the diff is attached to a revision ID that no longer exists, or the revision became invisible to the acting user between the other loads and this one.","triggerScenarios":"A diff row whose revision_id points at a deleted revision; a view-policy change that hides the revision from the user mid-flow.","commonSituations":"Revisions deleted while their diffs remained; policy restrictions applied to a project after users had already loaded inline comment pages.","solutions":["Repair the orphaned diff row or purge it.","Check whether a view policy, not deletion, hides the revision from this specific user.","Retry with an account that can see the revision to distinguish policy from data loss."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  // perform the inline comment action\n} catch (Exception $ex) {\n  if (preg_match('/Unable to load revision/', $ex->getMessage())) {\n    // orphaned diff or policy change: check visibility first, then data repair\n  } else {\n    throw $ex;\n  }\n}","preventionTips":["Retry with an account that can see the revision to distinguish policy from data loss.","When deleting revisions, delete or detach their diffs in the same operation.","Review project view policies after tightening access; stale sessions hit this mid-flow."],"tags":["phabricator","differential","inline-comment","data-integrity"],"backgroundTag":"orphaned-reference","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}