{"record":{"id":"185adf37160a288d","repo":"chatboxai/chatbox","slug":"no-task-id-found-for-this-record","errorCode":null,"errorMessage":"No task ID found for this record","messagePattern":"No task ID found for this record","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"src/renderer/stores/imageGenerationActions.ts","lineNumber":453,"sourceCode":"\nexport function clearCurrentRecord(): void {\n  imageGenerationStore.getState().setCurrentRecordId(null)\n}\n\nexport async function resumeGeneration(recordId: string): Promise<ImageGeneration | null> {\n  const store = imageGenerationStore.getState()\n\n  if (store.currentGeneratingId !== null) {\n    throw new Error('Another image is being generated. Please wait.')\n  }\n\n  const record = await platform.getImageGenerationStorage().getById(recordId)\n  if (!record) {\n    throw new Error('Record not found')\n  }\n\n  if (!record.taskId) {\n    throw new Error('No task ID found for this record')\n  }\n\n  const licenseKey = getLicenseKey()\n  store.setCurrentGeneratingId(recordId)\n\n  // Create AbortController for resume operation\n  currentAbortController = new AbortController()\n  const signal = currentAbortController.signal\n\n  try {\n    // Check current status, then poll if not finished\n    const currentStatus = await pollImageTask(record.taskId, licenseKey, signal)\n\n    let finalResult = currentStatus\n    if (!currentStatus.is_finished) {\n      finalResult = await pollTaskUntilComplete(record.taskId, licenseKey, { signal })\n    }\n","sourceCodeStart":435,"sourceCodeEnd":471,"githubUrl":"https://github.com/chatboxai/chatbox/blob/81571269addb6bafb589a920b2883f1e1e084fd1/src/renderer/stores/imageGenerationActions.ts#L435-L471","documentation":"resumeGeneration requires record.taskId to re-poll the remote task. If the record exists but never received a taskId, resume cannot query the backend — there is no task to poll. The check at line 452 guards pollImageTask(record.taskId, ...) against an undefined id.","triggerScenarios":"The record was created (createRecord) but submitImageGeneration either failed or did not persist the returned taskId before the session ended. Also fires after retryGeneration, which intentionally clears taskId (line ~532) — calling resume on a record mid-retry hits this.","commonSituations":"A previous generation crashed between record creation and taskId persistence (network drop during submit), or the UI offered a resume action on a record that retryGeneration already reset.","solutions":["Offer retry (not resume) in the UI when record.taskId is missing; resume only when taskId is present.","Ensure submitImageGeneration writes taskId to the record in the same transaction as creation.","Return a typed error so the UI can redirect the user to retry.","Filter the resume action by record.taskId truthiness in the record card component."],"exampleFix":"// before\nif (!record.taskId) {\n  throw new Error('No task ID found for this record')\n}\n// after\nif (!record.taskId) {\n  throw new RetryableGenerationError('No task ID found for this record')\n}","handlingStrategy":"type-guard","validationCode":"const record = await platform.getImageGenerationStorage().getById(recordId)\nif (record && !record.taskId) {\n  // offer retry, not resume\n  promptRetry()\n  return null\n}","typeGuard":"function hasTaskId(r: { taskId?: string | null } | null | undefined): r is { taskId: string } {\n  return !!r && typeof r.taskId === 'string' && r.taskId.length > 0\n}","tryCatchPattern":null,"preventionTips":["Offer retry (not resume) in the UI when record.taskId is missing.","Persist taskId in the same transaction as record creation.","Filter the resume action by record.taskId truthiness."],"tags":["image-generation","resume","storage","state-machine"],"backgroundTag":null,"analyzedSha":"81571269addb6bafb589a920b2883f1e1e084fd1","analyzedAt":"2026-08-12T21:51:44.981Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}