{"record":{"id":"58221000e52697a3","repo":"stablyai/orca","slug":"unable-to-load-committed-changes","errorCode":null,"errorMessage":"Unable to load committed changes","messagePattern":"Unable to load committed changes","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"mobile/src/source-control/use-mobile-source-control-loaders.ts","lineNumber":137,"sourceCode":"        }\n        const response = await client.sendRequest('git.branchCompare', {\n          worktree: `id:${worktreeId}`,\n          baseRef\n        })\n        if (!isCurrentLoad()) {\n          return false\n        }\n        if (!response.ok) {\n          if (isMobileGitUnavailable(response.error?.code, response.error?.message)) {\n            setBranchCompareState((prev) => {\n              if (options?.preserveReadyOnFailure && prev.kind === 'ready') {\n                return prev\n              }\n              return { kind: 'idle' }\n            })\n            return false\n          }\n          throw new Error(response.error?.message || 'Unable to load committed changes')\n        }\n        setBranchCompareState({\n          kind: 'ready',\n          result: (response as RpcSuccess).result as MobileGitBranchCompareResult\n        })\n        return true\n      } catch (err) {\n        if (!isCurrentLoad()) {\n          return false\n        }\n        const message = err instanceof Error ? err.message : 'Unable to load committed changes'\n        setBranchCompareState((prev) => {\n          if (options?.preserveReadyOnFailure && prev.kind === 'ready') {\n            return prev\n          }\n          return { kind: 'error', message }\n        })\n        return false","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/mobile/src/source-control/use-mobile-source-control-loaders.ts#L119-L155","documentation":"Thrown by `loadBranchCompare` when the `git.branchCompare` RPC returns ok:false with a code that is not a mobile-git-unavailable signal. Git-unavailable failures instead reset the compare state to idle (or keep the prior ready state under `preserveReadyOnFailure`). The catch at 148 reuses the same literal for non-Error throws. This populates the Changes-screen branch-compare error state.","triggerScenarios":"Loading the Changes/branch-compare view where `resolveMobileBranchCompareBaseRef` returned a base ref but `git.branchCompare` then fails with a real error — invalid baseRef, git internal error, worktree selector stale, or merge-base computation failure.","commonSituations":"The base ref resolved but points to a ref that no longer exists; the host's git failed to compute a merge base (divergent history, shallow clone); race where the worktree changed identity mid-load; mixed versions where the compare params shape changed.","solutions":["Read the propagated `error.message`/`code` to find the host-side git failure.","Refresh status (Retry) — the branch-compare load runs again with a fresh base ref.","Ensure the repo is not a shallow clone if merge-base computation fails (unshallow if needed).","Update the desktop host to a version matching the mobile client's `git.branchCompare` contract."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// loadBranchCompare already catches and sets branchCompareState to error;\n// callers should respect preserveReadyOnFailure to avoid flashing.\ntry {\n  await loadBranchCompare({ preserveReadyOnFailure: true })\n} catch {\n  // state already set to error; Retry button re-runs the load\n}","preventionTips":["Use preserveReadyOnFailure after mutations so a racing compare failure doesn't wipe the screen.","Refresh base ref before re-running compare to avoid stale-ref errors.","Surface the host error code so transient vs permanent failures are distinguishable."],"tags":["rpc","source-control","git","branch-compare"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}