toeverything/AFFiNE · error · Error
Failed to create transcription block
Error message
Failed to create transcription block
What it means
ensureTranscriptionBlock searches an attachment block's children for a transcription block and creates one if missing; if addBlock succeeds but the block cannot be retrieved afterwards, it throws this Error — an internal consistency failure.
Source
Thrown at packages/frontend/apps/electron-renderer/src/app/effects/recording.ts:151
function ensureTranscriptionBlock(model: AttachmentBlockModel) {
for (const key of model.childMap.value.keys()) {
const block = model.store.getBlock$(key);
if (block?.flavour === TRANSCRIPTION_BLOCK_FLAVOUR) {
return block.model as unknown as TranscriptionBlockModel;
}
}
const blockId = model.store.addBlock(
TRANSCRIPTION_BLOCK_FLAVOUR,
{ transcription: {} },
model.id
);
const block = model.store.getBlock(blockId)?.model as
| TranscriptionBlockModel
| undefined;
if (!block) {
throw new Error('Failed to create transcription block');
}
return block;
}
async function createRecordingDoc(
frameworkProvider: FrameworkProvider,
workspace: WorkspaceHandle['workspace'],
status: RecordingImportStatus
) {
if (!status.docId) {
throw new Error('Recording import is missing docId');
}
const docsService = workspace.scope.get(DocsService);
const aiEnabled = isAiEnabled(frameworkProvider);
const { attachmentName, timestamp } = getAttachmentName(status);
const targetDocId = status.docId;
const docExists = !!docsService.list.doc$(targetDocId).value;View on GitHub (pinned to b4c8548c09)
Solutions
- Retry the recording import; block creation can fail on transient doc state.
- Verify the recording doc exists and is writable before adding the transcription block.
- Check the console for the underlying doc error and resolve it first.
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at packages/frontend/apps/electron-renderer/src/app/effects/recording.ts:151 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of toeverything/AFFiNE@b4c8548c09 (2026-08-18).
Data as JSON: /api/errors/a958459009e4145f.
Report an issue: GitHub.