{"record":{"id":"dedc77eb3ed77ed9","repo":"toeverything/AFFiNE","slug":"failed-to-fetch-recording-file-response-status","errorCode":null,"errorMessage":"Failed to fetch recording file: ${response.status} ${response.statusText}","messagePattern":"Failed to fetch recording file: (.+?) (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/frontend/apps/electron-renderer/src/app/effects/recording.ts","lineNumber":76,"sourceCode":"    try {\n      return await apis.recording.readRecordingFile(filepath);\n    } catch (error) {\n      logger.error(\n        'Failed to read recording file via IPC, fallback to fetch',\n        error\n      );\n    }\n  }\n\n  const fileUrl = new URL(\n    filepath,\n    typeof location !== 'undefined' && location.protocol === 'assets:'\n      ? 'assets://local-file'\n      : location.origin\n  );\n  const response = await fetch(fileUrl);\n  if (!response.ok) {\n    throw new Error(\n      `Failed to fetch recording file: ${response.status} ${response.statusText}`\n    );\n  }\n  return response.arrayBuffer();\n}\n\nasync function saveRecordingBlob(blobEngine: BlobEngine, filepath: string) {\n  logger.debug('Saving recording', filepath);\n  const opusBuffer = await readRecordingFile(filepath);\n  const blob = new Blob([opusBuffer], {\n    type: NATIVE_RECORDING_MIME_TYPE,\n  });\n  const blobId = await blobEngine.set(blob);\n  logger.debug('Recording saved', blobId);\n  return { blob, blobId };\n}\n\nfunction getAttachmentName(status: RecordingImportStatus) {","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/toeverything/AFFiNE/blob/b4c8548c09da21b2898443559a5b846f0ccf5dd8/packages/frontend/apps/electron-renderer/src/app/effects/recording.ts#L58-L94","documentation":"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.","triggerScenarios":"Thrown at packages/frontend/apps/electron-renderer/src/app/effects/recording.ts:76 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","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."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b4c8548c09da21b2898443559a5b846f0ccf5dd8","analyzedAt":"2026-08-18T21:16:52.546Z","contentChangedAt":"2026-08-18T21:16:52.546Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}