{"record":{"id":"71dce83fd21a0d52","repo":"stablyai/orca","slug":"the-file-opened-but-its-tab-isn-t-ready-yet-try","errorCode":null,"errorMessage":"The file opened, but its tab isn't ready yet. Try again.","messagePattern":"The file opened, but its tab isn't ready yet\\. Try again\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"mobile/src/source-control/use-mobile-source-control-openers.ts","lineNumber":146,"sourceCode":"          throw new Error(response.error?.message || 'Unable to open diff')\n        }\n        if (!mountedRef.current) {\n          return\n        }\n        const revealResult = await revealMobileSourceControlSessionDiff({\n          client,\n          worktreeId,\n          relativePath: entry.path,\n          tabMode: openedTabMode,\n          staged: entry.area === 'staged',\n          onOpenedFileDiff,\n          isCurrent: () => mountedRef.current && openingPathRef.current === entry.path\n        })\n        if (revealResult === 'cancelled') {\n          return\n        }\n        if (revealResult === 'timeout') {\n          throw new Error(\"The file opened, but its tab isn't ready yet. Try again.\")\n        }\n        triggerSelection()\n        // Why: when launched from the session screen, opening a file dismisses\n        // this surface back to the session. In embedded mode there is nothing\n        // to pop (the panel docks beside the terminal), so close the dock\n        // instead of calling router.back() — falling back to router.back() when\n        // no close handler is wired, mirroring MobileSourceControlPanel, so the\n        // panel never sits on top of the activated diff tab.\n        if (embedded) {\n          ;(onRequestClose ?? (() => router.back()))()\n        } else {\n          router.back()\n        }\n      } catch (err) {\n        if (!mountedRef.current) {\n          return\n        }\n        triggerError()","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/mobile/src/source-control/use-mobile-source-control-openers.ts#L128-L164","documentation":"Thrown by `openFile` when `revealMobileSourceControlSessionDiff` returns `'timeout'`. That helper polls `session.tabs.list` at 0/300/600/900ms looking for a newly created file tab matching the path and mode; if no matching tab appears (or it appears but cannot be activated) across all four attempts, it returns timeout. The message is user-actionable — the file did open, just the session tab wasn't ready in time.","triggerScenarios":"Tapping a file to open a diff where `files.openDiff`/`files.open` succeeded but the resulting session tab never became visible within ~1.8s — slow host, tab creation delayed, the tab list RPC kept failing, or the tab was created with a mode/path that didn't match the filter.","commonSituations":"Host under load (tab creation slow); relay latency inflating each poll round; the desktop opened the tab in a different mode than expected so the matcher skipped it; the user navigated away (cancelled) but timing landed as timeout.","solutions":["Tap the file again — the tab often appears on the second attempt since the first open primed it.","Reduce host load / close unused tabs to speed session tab creation.","Switch to a direct (non-relay) connection to cut latency.","If it persists, check that the desktop tab mode matches 'diff'/'edit' the mobile filter expects."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"// The timeout is recoverable — the file tab usually lands on a second tap.\ntry {\n  await openFile(entry)\n} catch (err) {\n  if (err instanceof Error && err.message.includes(\"isn't ready yet\")) {\n    await openFile(entry) // retry once; first open primed the tab\n  } else throw err\n}","preventionTips":["Retry once on timeout — the tab was created, just not yet visible.","Reduce host load / open-tab latency to stay within the ~1.8s poll budget.","Switch to direct connection to cut relay round-trips on each poll."],"tags":["source-control","diff","timing","session-tabs","polling"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}