{"record":{"id":"529c4797f9bdbab4","repo":"multica-ai/multica","slug":"failed-to-load-child-progress-for-export","errorCode":null,"errorMessage":"Failed to load child progress for export","messagePattern":"Failed to load child progress for export","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/views/issues/surface/use-issue-surface-data.ts","lineNumber":301,"sourceCode":"  const projectMap = useMemo(\n    () => new Map(projects.map((project) => [project.id, project])),\n    [projects],\n  );\n  const resolveTableExportLookups = useCallback(\n    async (needs: { projects: boolean; childProgress: boolean }) => {\n      const [projectResult, progressResult] = await Promise.all([\n        needs.projects ? refetchProjects() : Promise.resolve(null),\n        needs.childProgress\n          ? refetchChildProgress()\n          : Promise.resolve(null),\n      ]);\n      if (projectResult?.error) throw projectResult.error;\n      if (progressResult?.error) throw progressResult.error;\n      if (needs.projects && !projectResult?.data) {\n        throw new Error(\"Failed to load project data for export\");\n      }\n      if (needs.childProgress && !progressResult?.data) {\n        throw new Error(\"Failed to load child progress for export\");\n      }\n      const resolvedProjects = projectResult?.data ?? projects;\n      return {\n        projectMap: new Map(\n          resolvedProjects.map((project) => [project.id, project]),\n        ),\n        childProgressMap: progressResult?.data ?? childProgressMap,\n      };\n    },\n    [\n      childProgressMap,\n      projects,\n      refetchChildProgress,\n      refetchProjects,\n    ],\n  );\n\n  const visibleStatuses = useMemo<IssueStatus[]>(() => {","sourceCodeStart":283,"sourceCodeEnd":319,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/packages/views/issues/surface/use-issue-surface-data.ts#L283-L319","documentation":"Companion guard to the project-data check in resolveTableExportLookups: thrown when the export requested child-progress lookups, refetchChildProgress resolved without an error field, but progressResult.data is empty/undefined. It prevents exporting a table whose child-progress column would silently show blanks.","triggerScenarios":"Exporting with a child-progress (sub-issue rollup) column while the child-progress query returns success with undefined data; hierarchy data query disabled or keyed to a stale workspace; refetch resolving after the component began tearing down.","commonSituations":"Saved column layouts including progress rollups; workspaces where issues have no sub-issues and the query short-circuits to undefined; race between export and query invalidation.","solutions":["Retry the export once the workspace data has settled.","Confirm the child-progress query is enabled and keyed to the current workspace and filter set.","Drop the child-progress column from the export if rollups are not required.","If developing: make the query return [] for the no-hierarchy case instead of undefined so the needs-childProgress path has data."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Before export: ensure child-progress data is loaded when the column is shown\nif (needs.childProgress && !childProgressMap) {\n  await refetchChildProgress();\n}","typeGuard":null,"tryCatchPattern":"try {\n  const lookups = await resolveTableExportLookups({ projects: false, childProgress: true });\n} catch (err) {\n  notifyExportBlocked(err instanceof Error ? err.message : \"export lookups unavailable\");\n}","preventionTips":["Make the hierarchy/child-progress query resolve to [] for no-subissue workspaces instead of undefined.","Only set needs.childProgress when a progress column is actually in the export.","Invalidate/refetch hierarchy data right before export so it is fresh."],"tags":["export","react-query","child-progress","issues-surface","typescript"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}