{"record":{"id":"0fbf9b764d565044","repo":"jlcodes99/cockpit-tools","slug":"antigravityinstalledversionbadge-failed-to-load","errorCode":null,"errorMessage":"[AntigravityInstalledVersionBadge] failed to load installed version:","messagePattern":"\\[AntigravityInstalledVersionBadge\\] failed to load installed version:","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"src/components/AntigravityInstalledVersionBadge.tsx","lineNumber":30,"sourceCode":"  const { t } = useTranslation();\n  const runtimeTarget = useAntigravityRuntimeTarget();\n  const [info, setInfo] = useState<AntigravityInstalledVersionInfo | null>(null);\n  const [loaded, setLoaded] = useState(false);\n\n  useEffect(() => {\n    let cancelled = false;\n    let timer = 0;\n    setLoaded(false);\n\n    const loadVersion = async () => {\n      try {\n        const quickInfo = await getAntigravityInstalledVersionInfo(runtimeTarget, 'quick');\n        if (!cancelled) {\n          setInfo(quickInfo);\n          setLoaded(!!quickInfo);\n        }\n      } catch (error) {\n        console.warn('[AntigravityInstalledVersionBadge] failed to load installed version:', error);\n        if (!cancelled) {\n          setInfo(null);\n        }\n      }\n\n      try {\n        const fullInfo = await getAntigravityInstalledVersionInfo(runtimeTarget, 'full');\n        if (!cancelled) {\n          if (fullInfo) {\n            setInfo(fullInfo);\n          }\n          setLoaded(true);\n        }\n      } catch (error) {\n        console.warn('[AntigravityInstalledVersionBadge] failed to complete installed version scan:', error);\n        if (!cancelled) {\n          setLoaded(true);\n        }","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/jlcodes99/cockpit-tools/blob/1ed8b77992d62ca81fabf744deb0839ad361d5bf/src/components/AntigravityInstalledVersionBadge.tsx#L12-L48","documentation":"The badge's `loadVersion` calls the Tauri command behind `getAntigravityInstalledVersionInfo(runtimeTarget, 'quick')` to read the locally installed Antigravity version. A rejection (command error, IPC failure, or filesystem/read error on the install metadata) is caught and logged, and the badge resets its info to null.","triggerScenarios":"The `quick` version scan throws: the Antigravity install directory is missing or unreadable, the version file is malformed, the Tauri command rejects, or the component's runtimeTarget does not match any installed build.","commonSituations":"Antigravity not installed or partially uninstalled; permission-restricted install path; version manifest format changed after an app update; calling with the wrong runtimeTarget value.","solutions":["Verify Antigravity is installed at the expected path and the version metadata file exists and parses.","Check the runtimeTarget argument matches a supported target in the backend command.","Inspect the logged `error` object for the underlying Tauri command rejection reason and fix that command's failure (permissions, path).","Add a fallback UI state (e.g. 'unknown version') instead of silently hiding the badge."],"exampleFix":"null","handlingStrategy":"fallback","validationCode":"const info = await safeGetInfo();\nasync function safeGetInfo() {\n  try { return await getAntigravityInstalledVersionInfo(runtimeTarget, 'quick'); }\n  catch { return null; }\n}","typeGuard":"function hasVersionInfo(v: unknown): v is { version: string } {\n  return typeof v === 'object' && v !== null && 'version' in v && typeof (v as any).version === 'string';\n}","tryCatchPattern":"try {\n  const info = await getAntigravityInstalledVersionInfo(runtimeTarget, 'quick');\n  setInfo(info ?? null);\n} catch {\n  setInfo(null); // render 'version unknown' placeholder\n}","preventionTips":["Render an 'unknown version' placeholder rather than hiding the badge silently","Validate install path existence before invoking the scan","Keep runtimeTarget values in a shared constant to avoid typos"],"tags":["tauri","ipc","version-scan","fallback"],"backgroundTag":"tauri-command-invocation-failed","analyzedSha":"1ed8b77992d62ca81fabf744deb0839ad361d5bf","analyzedAt":"2026-09-05T09:51:41.178Z","contentChangedAt":"2026-09-05T09:51:41.178Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}