chatboxai/chatbox · warning · Error
Record not found
Error message
Record not found
What it means
Thrown by resumeGeneration when platform.getImageGenerationStorage().getById(recordId) returns null. The persistent image-generation record store could not find the id passed in, so there is nothing to resume.
Source
Thrown at src/renderer/stores/imageGenerationActions.ts:449
imageGenerationStore.getState().setCurrentRecordId(record.id)
}
return record
}
export function clearCurrentRecord(): void {
imageGenerationStore.getState().setCurrentRecordId(null)
}
export async function resumeGeneration(recordId: string): Promise<ImageGeneration | null> {
const store = imageGenerationStore.getState()
if (store.currentGeneratingId !== null) {
throw new Error('Another image is being generated. Please wait.')
}
const record = await platform.getImageGenerationStorage().getById(recordId)
if (!record) {
throw new Error('Record not found')
}
if (!record.taskId) {
throw new Error('No task ID found for this record')
}
const licenseKey = getLicenseKey()
store.setCurrentGeneratingId(recordId)
// Create AbortController for resume operation
currentAbortController = new AbortController()
const signal = currentAbortController.signal
try {
// Check current status, then poll if not finished
const currentStatus = await pollImageTask(record.taskId, licenseKey, signal)
let finalResult = currentStatusView on GitHub (pinned to 81571269ad)
Solutions
- Remove the UI card when its underlying record is deleted; refresh the list query on resume error.
- Invalidate stale recordIds held in component state when queryClient refetches IMAGE_GEN_LIST_QUERY_KEY.
- Return null instead of throwing for a missing record so the caller can silently dismiss.
- Guard the caller: verify the recordId still exists in the cached list before calling resumeGeneration.
Example fix
// before
const record = await platform.getImageGenerationStorage().getById(recordId)
if (!record) throw new Error('Record not found')
// after
const record = await platform.getImageGenerationStorage().getById(recordId)
if (!record) {
log.warn('resumeGeneration: record vanished', recordId)
queryClient.invalidateQueries({ queryKey: [IMAGE_GEN_LIST_QUERY_KEY] })
return null
} Defensive patterns
Strategy: validation
Validate before calling
const record = await platform.getImageGenerationStorage().getById(recordId)
if (!record) {
queryClient.invalidateQueries({ queryKey: [IMAGE_GEN_LIST_QUERY_KEY] })
return null
} Type guard
function recordExists<T>(r: T | null | undefined): r is T {
return r != null
} Prevention
- Refresh the list query when a record is deleted so stale ids are pruned.
- Verify the recordId still exists in the cached list before calling resumeGeneration.
- Return null instead of throwing for a vanished record.
When it happens
Trigger: A resume call references a recordId that no longer exists in storage: the record was deleted by the user/history cleanup, the id is stale (from a closed tab), or storage was wiped (cache clear, logout). Also possible after a schema migration that dropped old records.
Common situations: User deletes an image record then clicks resume on a stale UI card, app cache cleared, logout cleared local storage, or a recordId passed from a deep link that never existed.
Related errors
- No task ID found for this record
- The image record linked to this approved tool call no longer
- No readable text content found in EPUB file
- Embedding batch failed: expected ${batchTexts.length}, got $
- Attachment content not found or empty
AI-assisted analysis of chatboxai/chatbox@81571269ad (2026-08-12).
Data as JSON: /api/errors/5a8aaff9b65d6b58.
Report an issue: GitHub.