toeverything/AFFiNE · error · Error
Failed to fetch recording file: ${response.status} ${respons
Error message
Failed to fetch recording file: ${response.status} ${response.statusText} What it means
A fetch-layer guard in the electron renderer: after an IPC attempt to read a recording file fails (logged, then falls back), the HTTP fetch of fileUrl returned a non-ok HTTP status. It fires when the recording asset cannot be retrieved over HTTP in the renderer — the interpolated numbers are the HTTP status code and status text of the failed response.
Source
Thrown at packages/frontend/apps/electron-renderer/src/app/effects/recording.ts:76
try {
return await apis.recording.readRecordingFile(filepath);
} catch (error) {
logger.error(
'Failed to read recording file via IPC, fallback to fetch',
error
);
}
}
const fileUrl = new URL(
filepath,
typeof location !== 'undefined' && location.protocol === 'assets:'
? 'assets://local-file'
: location.origin
);
const response = await fetch(fileUrl);
if (!response.ok) {
throw new Error(
`Failed to fetch recording file: ${response.status} ${response.statusText}`
);
}
return response.arrayBuffer();
}
async function saveRecordingBlob(blobEngine: BlobEngine, filepath: string) {
logger.debug('Saving recording', filepath);
const opusBuffer = await readRecordingFile(filepath);
const blob = new Blob([opusBuffer], {
type: NATIVE_RECORDING_MIME_TYPE,
});
const blobId = await blobEngine.set(blob);
logger.debug('Recording saved', blobId);
return { blob, blobId };
}
function getAttachmentName(status: RecordingImportStatus) {View on GitHub (pinned to b4c8548c09)
Solutions
- Check the HTTP status and status text in the message to diagnose the fetch failure.
- Verify the recording file URL is correct and the user is authorized to download it.
- Retry the download; for persistent failures check network and server availability.
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at packages/frontend/apps/electron-renderer/src/app/effects/recording.ts:76 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/dedc77eb3ed77ed9.
Report an issue: GitHub.