{"record":{"id":"8946b69c92fa32be","repo":"toeverything/AFFiNE","slug":"failed-to-create-recording-attachment","errorCode":null,"errorMessage":"Failed to create recording attachment","messagePattern":"Failed to create recording attachment","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/frontend/apps/electron-renderer/src/app/effects/recording.ts","lineNumber":223,"sourceCode":"      );\n\n      const attachmentId = doc.blockSuiteDoc.addBlock(\n        'affine:attachment',\n        {\n          name: attachmentName,\n          type: NATIVE_RECORDING_MIME_TYPE,\n          size: blob.size,\n          sourceId: blobId,\n          embed: true,\n        },\n        noteId\n      );\n\n      model = doc.blockSuiteDoc.getBlock(attachmentId)?.model as\n        | AttachmentBlockModel\n        | undefined;\n      if (!model) {\n        throw new Error('Failed to create recording attachment');\n      }\n      attachmentCreated = true;\n    }\n\n    const transcriptionBlock = ensureTranscriptionBlock(model);\n    transcriptionBlock.props.transcription = {\n      sourceAudio: {\n        mimeType: model.props.type,\n        durationMs: status.durationMs,\n        sampleRate: status.sampleRate,\n        channels: status.numberOfChannels,\n      },\n      quality: {\n        degraded: status.degraded,\n        overflowCount: status.overflowCount,\n      },\n    };\n","sourceCodeStart":205,"sourceCodeEnd":241,"githubUrl":"https://github.com/toeverything/AFFiNE/blob/b4c8548c09da21b2898443559a5b846f0ccf5dd8/packages/frontend/apps/electron-renderer/src/app/effects/recording.ts#L205-L241","documentation":"A post-write verification in createRecordingDoc: after calling doc.blockSuiteDoc.addBlock('affine:attachment', ...) the code immediately looks the new block up by the returned id. It fires when that lookup returns no model, meaning BlockSuite accepted the addBlock call but the block is not retrievable — a store/sync inconsistency or rejected block prop, not bad user input.","triggerScenarios":"Thrown at packages/frontend/apps/electron-renderer/src/app/effects/recording.ts:223 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the recording blob uploaded successfully before creating the attachment.","Retry the import; attachment creation can fail on transient storage errors.","Check storage quota and permissions for the workspace."],"exampleFix":null,"handlingStrategy":"try-catch","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"}