{"record":{"id":"33baf9a1ffa83d48","repo":"toeverything/AFFiNE","slug":"pdf-not-found","errorCode":null,"errorMessage":"PDF not found","messagePattern":"PDF not found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/frontend/core/src/modules/pdf/entities/pdf.ts","lineNumber":57,"sourceCode":"    from(\n      this.workspaceService.workspace.engine.blob\n        .get(this.id)\n        .then(blobRecord => {\n          if (blobRecord) {\n            const { data, mime: type } = blobRecord;\n            const blob = new Blob([toArrayBuffer(data)], { type });\n            return blob.arrayBuffer();\n          }\n\n          return null;\n        })\n    ).pipe(\n      switchMap(data => {\n        if (data) {\n          return this.renderer.ob$('open', { data });\n        }\n\n        throw new Error('PDF not found');\n      }),\n      map(meta => ({ status: PDFStatus.Opened, meta })),\n      // @ts-expect-error type alias\n      startWith({ status: PDFStatus.Opening }),\n      catchError((error: Error) => of({ status: PDFStatus.Error, error }))\n    ),\n    { status: PDFStatus.IDLE }\n  );\n\n  constructor(private readonly workspaceService: WorkspaceService) {\n    super();\n    this.disposables.push(() => this.pages.clear());\n  }\n\n  page(pageNum: number, size: string) {\n    const key = `${pageNum}:${size}`;\n    let rc = this.pages.get(key);\n","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/toeverything/AFFiNE/blob/b4c8548c09da21b2898443559a5b846f0ccf5dd8/packages/frontend/core/src/modules/pdf/entities/pdf.ts#L39-L75","documentation":"The PDF entity streams the blob from workspace blob storage; when get(id) resolves without a blob record (PDF deleted or never stored), the pipeline throws Error('PDF not found') in switchMap instead of emitting renderer output.","triggerScenarios":"Thrown in the PDF entity state stream when the workspace blob engine returns no blob record for the PDF's blobId, so no data can be fed to the renderer.","commonSituations":"A user opens a PDF attachment whose blob is missing or not yet synced to the workspace storage. Wait for sync to finish or re-upload the PDF.","solutions":["Ensure the PDF blob is uploaded before opening the viewer.","Verify the PDF id and storage 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-14T00:17:10.932Z"}