{"record":{"id":"d414bc0b5b0c8bf0","repo":"toeverything/AFFiNE","slug":"doc-not-found-d414bc","errorCode":null,"errorMessage":"Doc not found","messagePattern":"Doc not found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/frontend/core/src/modules/doc/services/docs.ts","lineNumber":112,"sourceCode":"    super();\n  }\n\n  loaded(docId: string) {\n    const exists = this.pool.get(docId);\n    if (exists) {\n      return { doc: exists.obj, release: exists.release };\n    }\n    return null;\n  }\n\n  open(docId: string) {\n    const docRecord = this.list.doc$(docId).value;\n    if (!docRecord) {\n      throw new Error('Doc record not found');\n    }\n    const blockSuiteDoc = this.store.getBlockSuiteDoc(docId);\n    if (!blockSuiteDoc) {\n      throw new Error('Doc not found');\n    }\n\n    const exists = this.pool.get(docId);\n    if (exists) {\n      return { doc: exists.obj, release: exists.release };\n    }\n\n    const docScope = this.framework.createScope(DocScope, {\n      docId,\n      blockSuiteDoc,\n      record: docRecord,\n    });\n\n    try {\n      blockSuiteDoc.load();\n    } catch (e) {\n      logger.error('Failed to load doc', {\n        docId,","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/toeverything/AFFiNE/blob/b4c8548c09da21b2898443559a5b846f0ccf5dd8/packages/frontend/core/src/modules/doc/services/docs.ts#L94-L130","documentation":"DocsService.open validates both that a doc record exists in the list (else 'Doc record not found') and that a BlockSuite doc exists in the store; this Error fires for the latter — docId has a record but no underlying BlockSuite doc, so it cannot be opened.","triggerScenarios":"Thrown by DocsService.open when the doc record exists in the list but store.getBlockSuiteDoc returns null, i.e. the underlying BlockSuite doc store for the docId is missing.","commonSituations":"Happens when opening a doc whose metadata exists but whose content store failed to load or is absent, often from incomplete sync or storage corruption. Resync or reload the workspace and retry.","solutions":["Check the doc id; the doc may have been removed.","Refresh the doc list and retry."],"exampleFix":null,"handlingStrategy":"type-guard","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"}