{"record":{"id":"2c5ca35bcaa9b93e","repo":"stablyai/orca","slug":"waiting-for-desktop-2c5ca3","errorCode":null,"errorMessage":"Waiting for desktop...","messagePattern":"Waiting for desktop\\.\\.\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"mobile/src/source-control/use-mobile-source-control-action-sheet-runners.ts","lineNumber":72,"sourceCode":"  }, [runCommitSyncSequence, setShowActionSheet])\n\n  const runActionSheetGitSequence = useCallback(\n    async (actionId: string, steps: GitStep[]) => {\n      await runGitSequence(actionId, steps)\n      setShowActionSheet(false)\n    },\n    [runGitSequence, setShowActionSheet]\n  )\n\n  const runActionSheetGitSync = useCallback(async () => {\n    await runGitSync('sync')\n    setShowActionSheet(false)\n  }, [runGitSync, setShowActionSheet])\n\n  const runActionSheetRebase = useCallback(async () => {\n    await runGitWorkflow('rebase', async () => {\n      if (!client) {\n        throw new Error('Waiting for desktop...')\n      }\n      const baseRef = await resolveMobileBranchCompareBaseRef(client, worktreeId)\n      if (!baseRef) {\n        throw new Error('No base branch to rebase onto')\n      }\n      await sendGitRequest<unknown>('git.rebaseFromBase', { baseRef })\n    })\n    setShowActionSheet(false)\n  }, [client, runGitWorkflow, sendGitRequest, setShowActionSheet, worktreeId])\n\n  return {\n    runActionSheetCommit,\n    runActionSheetCommitSequence,\n    runActionSheetCommitSync,\n    runActionSheetGitSequence,\n    runActionSheetGitSync,\n    runActionSheetRebase\n  }","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/mobile/src/source-control/use-mobile-source-control-action-sheet-runners.ts#L54-L90","documentation":"Guard at the top of the `runActionSheetRebase` workflow body. Before resolving a base ref it requires a non-null `client`; if the RPC client is not bound it throws 'Waiting for desktop...' inside `runGitWorkflow`, which records the action as failed. This mirrors the `sendGitRequest` connection guard but is checked explicitly because `resolveMobileBranchCompareBaseRef` needs the raw client.","triggerScenarios":"User taps Rebase in the action sheet while `client` is null (not yet paired, or pairing dropped). Distinct from connState checks because this runner receives `client` directly rather than going through `sendGitRequest`.","commonSituations":"Tapping Rebase immediately on screen open before the relay handshake completes; connection dropped mid-session and the action sheet is still open.","solutions":["Disable the Rebase action until `client` is bound and `connState === 'connected'`.","Retry after the connection stabilises.","Re-pair if the connection stays down."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Disable Rebase until the client is bound.\nconst canRebase = client !== null && connState === 'connected'","typeGuard":null,"tryCatchPattern":"try {\n  await runActionSheetRebase()\n} catch (err) {\n  if (err instanceof Error && err.message === 'Waiting for desktop...') {\n    setShowActionSheet(true) // keep the sheet open for retry\n  } else throw err\n}","preventionTips":["Gate the Rebase button on a non-null client and connected state.","Keep the action sheet open on this transient error so the user can retry."],"tags":["connection","source-control","rebase","guard"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}