{"record":{"id":"ddc660d13cc385c5","repo":"stablyai/orca","slug":"unable-to-load-committed-diff","errorCode":null,"errorMessage":"Unable to load committed diff","messagePattern":"Unable to load committed diff","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"mobile/src/source-control/use-mobile-source-control-openers.ts","lineNumber":246,"sourceCode":"          setOpeningBranchPath(null)\n        }\n        return\n      }\n      setBranchDiffPreview({ kind: 'loading', entry })\n      try {\n        const response = await client.sendRequest('git.branchDiff', {\n          worktree: `id:${worktreeId}`,\n          filePath: entry.path,\n          ...(entry.oldPath ? { oldPath: entry.oldPath } : {}),\n          compare: {\n            baseRef: summary.baseRef,\n            ...(summary.baseOid ? { baseOid: summary.baseOid } : {}),\n            headOid: summary.headOid,\n            mergeBase: summary.mergeBase\n          }\n        })\n        if (!response.ok) {\n          throw new Error(response.error?.message || 'Unable to load committed diff')\n        }\n        const result = (response as RpcSuccess).result as GitDiffTextResult | { kind: 'binary' }\n        if (result.kind !== 'text') {\n          throw new Error('Binary branch diff preview unavailable on mobile')\n        }\n        const diff = buildMobileDiffLines(result.originalContent, result.modifiedContent)\n        const syntaxLanguage = resolveMobileSyntaxLanguage(entry.path)\n        if (!mountedRef.current) {\n          return\n        }\n        setBranchDiffPreview({\n          kind: 'ready',\n          entry,\n          summary,\n          lines: highlightMobileDiffLines(diff.lines, syntaxLanguage),\n          truncated: diff.truncated\n        })\n        triggerSelection()","sourceCodeStart":228,"sourceCodeEnd":264,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/mobile/src/source-control/use-mobile-source-control-openers.ts#L228-L264","documentation":"Thrown by `openBranchDiff` (the committed/branch diff preview) when the `git.branchDiff` RPC returns ok:false. The server error message is preferred; the literal is a fallback. The catch at 273 reuses the literal for non-Error throws and sets the branch-diff preview to an error state.","triggerScenarios":"Tapping a committed change to preview its branch diff where `git.branchDiff` fails — invalid/expired baseRef/baseOid/headOid/mergeBase in the compare block, git internal error computing the diff, the path or oldPath no longer resolves, or a size limit exceeded.","commonSituations":"The branch has been force-pushed so the stored OIDs no longer exist; a shallow clone cannot resolve the merge base; the diff is enormous and the host aborts; mixed versions where the `compare` param shape differs.","solutions":["Reload branch compare (the Changes screen refresh) to get fresh baseRef/OIDs, then reopen the diff.","Read the propagated error message for the host-side git reason.","If the repo is shallow, unshallow it so the merge base resolves.","Update the desktop host to match the mobile `git.branchDiff` compare contract."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// openBranchDiff already catches and sets branchDiffPreview to error;\n// reload branch compare to refresh OIDs, then reopen.\ntry {\n  await openBranchDiff(entry)\n} catch {\n  await loadBranchCompare({ preserveReadyOnFailure: true })\n}","preventionTips":["Reload branch compare before reopening a diff so baseRef/OIDs are current.","Unshallow clones that fail merge-base computation.","Keep mobile and desktop versions aligned on the git.branchDiff compare shape."],"tags":["rpc","source-control","git","diff","branch-diff"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}