{"record":{"id":"c177f328ee29a675","repo":"stablyai/orca","slug":"binary-branch-diff-preview-unavailable-on-mobile","errorCode":null,"errorMessage":"Binary branch diff preview unavailable on mobile","messagePattern":"Binary branch diff preview unavailable on mobile","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"info","filePath":"mobile/src/source-control/use-mobile-source-control-openers.ts","lineNumber":250,"sourceCode":"      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()\n      } catch (err) {\n        if (!mountedRef.current) {\n          return\n        }","sourceCodeStart":232,"sourceCodeEnd":268,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/mobile/src/source-control/use-mobile-source-control-openers.ts#L232-L268","documentation":"Thrown by `openBranchDiff` when `git.branchDiff` succeeds but the result is not a text diff — `result.kind !== 'text'` (i.e. `{ kind: 'binary' }`). Mobile cannot render a binary file's diff inline, so rather than show a blank/broken preview it throws this informative message. This is an expected capability boundary, not a crash.","triggerScenarios":"Tapping a committed change for a binary file (image, compiled asset, PDF, etc.) in the branch-diff preview; the host correctly returns `{ kind: 'binary' }` and mobile declines to render it.","commonSituations":"Reviewing commits that touch images, fonts, build artifacts, or any non-text file; a file that was detected as binary by git's heuristics even though it's technically text.","solutions":["Open the binary file in its native viewer/editor instead of the inline diff preview.","On desktop, view the diff there where binary rendering is supported.","If the file is actually text but misdetected as binary, add a gitattributes `diff`/`text` hint and retry."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":"function isTextBranchDiff(result: unknown): result is GitDiffTextResult {\n  return !!result && typeof result === 'object' && (result as { kind?: string }).kind === 'text'\n}","tryCatchPattern":"// This is an expected capability limit — degrade gracefully, don't retry.\nif (result.kind !== 'text') {\n  setBranchDiffPreview({ kind: 'error', entry, message: 'Binary branch diff preview unavailable on mobile' })\n  return\n}","preventionTips":["Guard the result kind before rendering so binary files show a clean message instead of crashing.","Offer to open binary files in their native viewer.","Add gitattributes text hints for files git misclassifies as binary."],"tags":["source-control","diff","binary","mobile","capability"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}