{"record":{"id":"1b0ee16cbde3a5ae","repo":"stablyai/orca","slug":"response-error-message-1b0ee1","errorCode":null,"errorMessage":"response.error.message","messagePattern":"response\\.error\\.message","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"mobile/src/tasks/smart-source-search-requests.ts","lineNumber":37,"sourceCode":"// both types. So pass the raw trimmed query straight through (an explicit\n// `is:pr`/`is:issue` the user typed is honored by the runtime); empty stays empty\n// so the runtime lists recent issues + PRs.\nexport function scopeGitHubQuery(query: string): string {\n  return query.trim()\n}\n\nexport async function searchGitHubItems(\n  client: RpcClient,\n  repoId: string,\n  query: string\n): Promise<GitHubWorkItem[]> {\n  const response = await client.sendRequest('github.listWorkItems', {\n    repo: `id:${repoId}`,\n    limit: PER_REPO_FETCH_LIMIT,\n    query: scopeGitHubQuery(query)\n  })\n  if (!response.ok) {\n    throw new Error(response.error.message)\n  }\n  const envelope = (response as RpcSuccess).result as { items: GitHubWorkItem[] }\n  // Stamp repoId so the shared row builder + create flow can attribute each item\n  // to the searched repo (the runtime omits it, like the desktop fetcher).\n  return (envelope.items ?? []).map((item) => ({ ...item, repoId }))\n}\n\nexport async function searchGitLabItems(\n  client: RpcClient,\n  repoId: string,\n  query: string,\n  state: MrStateFilter\n): Promise<GitLabWorkItem[]> {\n  const response = await client.sendRequest('gitlab.listWorkItems', {\n    repo: `id:${repoId}`,\n    state,\n    page: 1,\n    perPage: GITLAB_PER_PAGE,","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/mobile/src/tasks/smart-source-search-requests.ts#L19-L55","documentation":"The github.listWorkItems RPC returned an RpcFailure (response.ok === false) during a GitHub issue/PR search. The call sends { repo, limit: PER_REPO_FETCH_LIMIT, query } and expects { items: GitHubWorkItem[] } on success. A failure is a transport or provider-level rejection from the host's GitHub integration.","triggerScenarios":"GitHub not configured for the repo; host's GitHub token expired; 'method_not_found' on older runtimes; the host's GitHub search hit a rate limit; transport broke mid-search.","commonSituations":"User types in the smart source picker for a repo without GitHub linked; host GitHub PAT revoked; mixed mobile/desktop versions; aggressive search queries hitting GitHub rate limits.","solutions":["Catch and return [] (empty results) with a visible 'GitHub unavailable' indicator instead of crashing the search panel.","If 'method_not_found', disable the GitHub tab for that repo.","Inspect response.error.data for rate-limit reset timing and surface 'try again in N seconds'.","Retry with exponential backoff for transient 'runtime_error' codes."],"exampleFix":"// before\nif (!response.ok) {\n  throw new Error(response.error.message)\n}\n\n// after — degrade to empty + signal so the UI shows a provider-down banner\nif (!response.ok) {\n  if (response.error.code === 'method_not_found') return []\n  throw response.error // let the caller decide empty-vs-error\n}","handlingStrategy":"fallback","validationCode":"if (client.getState() !== 'connected') {\n  return [] // cannot search while disconnected\n}","typeGuard":"function isRpcFailure(r: RpcResponse): r is RpcFailure {\n  return !r.ok\n}","tryCatchPattern":"try {\n  const items = await searchGitHubItems(client, repoId, query)\n} catch (e) {\n  return [] // show 'GitHub unavailable' in the picker\n}","preventionTips":["Degrade to [] with a visible provider-down indicator instead of crashing the search panel.","Disable the GitHub tab for repos without GitHub linked or on method_not_found.","Inspect error.data for GitHub rate-limit reset timing."],"tags":["rpc","github","smart-source","search","mobile","network"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}