{"record":{"id":"db187f60f3281133","repo":"toeverything/AFFiNE","slug":"doc-record-not-found","errorCode":null,"errorMessage":"Doc record not found","messagePattern":"Doc record not found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/frontend/core/src/modules/doc/services/docs.ts","lineNumber":108,"sourceCode":"    private readonly store: DocsStore,\n    private readonly docPropertiesStore: DocPropertiesStore,\n    private readonly docCreateMiddlewares: DocCreateMiddleware[]\n  ) {\n    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 {","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/toeverything/AFFiNE/blob/b4c8548c09da21b2898443559a5b846f0ccf5dd8/packages/frontend/core/src/modules/doc/services/docs.ts#L90-L126","documentation":"DocsService.open throws when the doc list has no doc record for the given id, meaning the docId is unknown to the workspace (deleted or never existed); callers open docs by id assuming a record exists.","triggerScenarios":"Thrown by DocsService.open when the requested docId has no record in the workspace doc list (list.doc$ is null), meaning the doc metadata does not exist or has been deleted.","commonSituations":"A user opens a link or reference to a doc that was deleted or never synced to this workspace. Verify the doc exists in the page list and that sync has completed before reopening.","solutions":["Verify the doc record exists in the workspace before accessing it.","Refresh the doc list; the doc may have been deleted."],"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-14T00:17:10.932Z"}