{"record":{"id":"f705ee0385013a23","repo":"paperclipai/paperclip","slug":"no-company-selected-f705ee","errorCode":null,"errorMessage":"No company selected","messagePattern":"No company selected","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"ui/src/pages/ProjectDetail.tsx","lineNumber":475,"sourceCode":"      const name = updatedProject?.name ?? project?.name ?? \"Project\";\n      if (archived) {\n        pushToast({ title: `\"${name}\" has been archived`, tone: \"success\" });\n        navigate(\"/dashboard\");\n      } else {\n        pushToast({ title: `\"${name}\" has been unarchived`, tone: \"success\" });\n      }\n    },\n    onError: (_, archived) => {\n      pushToast({\n        title: archived ? \"Failed to archive project\" : \"Failed to unarchive project\",\n        tone: \"error\",\n      });\n    },\n  });\n\n  const uploadImage = useMutation({\n    mutationFn: async (file: File) => {\n      if (!resolvedCompanyId) throw new Error(\"No organization selected\");\n      return assetsApi.uploadImage(resolvedCompanyId, file, `projects/${projectLookupRef || \"draft\"}`);\n    },\n  });\n\n  const { data: budgetOverview } = useQuery({\n    queryKey: queryKeys.budgets.overview(resolvedCompanyId ?? \"__none__\"),\n    queryFn: () => budgetsApi.overview(resolvedCompanyId!),\n    enabled: !!resolvedCompanyId,\n    refetchInterval: 30_000,\n    staleTime: 5_000,\n  });\n\n  useEffect(() => {\n    setBreadcrumbs([\n      { label: \"Projects\", href: \"/projects\" },\n      { label: project?.name ?? routeProjectRef ?? \"Project\" },\n    ]);\n  }, [setBreadcrumbs, project, routeProjectRef]);","sourceCodeStart":457,"sourceCodeEnd":493,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/ui/src/pages/ProjectDetail.tsx#L457-L493","documentation":"Scope guard in the project image upload mutation: the upload endpoint is company-scoped and resolvedCompanyId is falsy (no company resolved from route/selection context), so the image upload aborts before any request is made.","triggerScenarios":"Thrown at ui/src/pages/ProjectDetail.tsx:513 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Select a company from the company picker before performing this action."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}