toeverything/AFFiNE · error · BadRequestException
Ready or settled transcript tasks cannot be retried
Error message
Ready or settled transcript tasks cannot be retried
What it means
A BadRequestException guard in the transcript retry flow: it fires when retryTask is invoked on a task whose status is 'ready' or 'settled', i.e. transcription already completed and produced a final result. Retrying such tasks is meaningless, so the request is rejected before any job is re-enqueued; the input at fault is taskId pointing at an already-finished task.
Solutions
- Only retry jobs that are in a failed state; ready or settled jobs are final.
- Check the job status first and skip the retry when it already succeeded.
- If the result is wrong, create a new transcription job instead of retrying a settled one.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at packages/backend/server/src/plugins/copilot/transcript/retry.ts:42 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of toeverything/AFFiNE@2af30773ae (2026-08-18).
Data as JSON: /api/errors/0491bcb9db170b74.
Report an issue: GitHub.
Appendix: source
Thrown at packages/backend/server/src/plugins/copilot/transcript/retry.ts:42
async retryTask(
userId: string,
workspaceId: string,
taskId: string,
personal?: boolean
) {
const task = await this.models.copilotTranscriptTask.getWithUser(
userId,
workspaceId,
taskId,
undefined,
personal
);
if (!task) {
throw new CopilotTranscriptionJobNotFound();
}
if (task.status === 'ready' || task.status === 'settled') {
throw new BadRequestException(
'Ready or settled transcript tasks cannot be retried'
);
}
if (task.status !== 'failed') {
throw new BadRequestException(
'Only failed transcript tasks can be retried'
);
}
const payload = TranscriptPayloadSchema.parse(task.protectedResult);
await this.runtime.assertRoute(
'transcript.audio',
{},
{
user: userId,
workspace: workspaceId,
featureKind: 'transcript',
builtInRouteId: TRANSCRIPT_PROMPT_REF,View on GitHub (pinned to 2af30773ae)