{"record":{"id":"5fefe2ad6ff64886","repo":"paperclipai/paperclip","slug":"work-product-not-found","errorCode":null,"errorMessage":"Work product not found","messagePattern":"Work product not found","errorType":"http","errorClass":null,"httpStatus":404,"severity":"error","filePath":"server/src/routes/issues.ts","lineNumber":8422,"sourceCode":"          title: result.document.title,\n        },\n      });\n    }\n\n    res.json(result.document);\n  });\n\n  router.get(\"/issues/:id/documents/:key/revisions\", async (req, res) => {\n    const id = req.params.id as string;\n    const issue = await getAccessibleResource(req, res, getIssueById(req, id), \"Issue not found\");\n    if (!issue) return;\n    if (!(await assertIssueReadAllowed(req, res, issue))) return;\n    const keyParsed = issueDocumentKeySchema.safeParse(String(req.params.key ?? \"\").trim().toLowerCase());\n    if (!keyParsed.success) {\n      res.status(400).json({ error: \"Invalid document key\", details: keyParsed.error.issues });\n      return;\n    }\n    const revisions = await documentsSvc.listIssueDocumentRevisions(issue.id, keyParsed.data);\n    res.json(revisions);\n  });\n\n  router.post(\n    \"/issues/:id/documents/:key/revisions/:revisionId/restore\",\n    validate(restoreIssueDocumentRevisionSchema),\n    async (req, res) => {\n      const id = req.params.id as string;\n      const revisionId = req.params.revisionId as string;\n      const issue = await getAccessibleResource(req, res, svc.getById(id), \"Issue not found\");\n      if (!issue) return;\n      if (!(await assertAgentIssueMutationAllowed(req, res, issue))) return;\n      if (!(await assertDeliverableMutationAllowedByRunContext(req, res, issue))) return;\n      const keyParsed = issueDocumentKeySchema.safeParse(String(req.params.key ?? \"\").trim().toLowerCase());\n      if (!keyParsed.success) {\n        res.status(400).json({ error: \"Invalid document key\", details: keyParsed.error.issues });\n        return;\n      }","sourceCodeStart":8404,"sourceCodeEnd":8440,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/server/src/routes/issues.ts#L8404-L8440","documentation":"404 on work product update. Fires when the work product id in the URL does not resolve to a stored work product, or the resolved one does not belong to the given issue/company; the handler rejects before applying the patch.","triggerScenarios":"Thrown at server/src/routes/issues.ts:7835 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the id in the request path or body refers to an existing record in this company; re-list the parent collection to get a valid id.","Check that the record was not deleted or archived, and that the request is scoped to the correct companyId."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}