{"record":{"id":"cd9ba3b3b2ab2a76","repo":"paperclipai/paperclip","slug":"photon-message-deletion-is-not-supported","errorCode":null,"errorMessage":"Photon message deletion is not supported","messagePattern":"Photon message deletion is not supported","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/src/services/photon/adapter.ts","lineNumber":392,"sourceCode":"  async postMessage(\n    _id: string,\n    _message: AdapterPostableMessage,\n  ): Promise<never> {\n    throw new Error(\n      \"Photon sends require an immutable Paperclip publication identity\",\n    );\n  }\n  async editMessage(\n    _id: string,\n    _messageId: string,\n    _message: AdapterPostableMessage,\n  ): Promise<never> {\n    throw new Error(\n      \"Photon edits require an immutable Paperclip publication identity\",\n    );\n  }\n  async deleteMessage(): Promise<never> {\n    throw new Error(\"Photon message deletion is not supported\");\n  }\n  async addReaction(): Promise<void> {\n    /* Receipt reactions are intentionally not published. */\n  }\n  async removeReaction(): Promise<void> {\n    /* Reactions never represent approvals. */\n  }\n\n  async publish(\n    id: string,\n    publicationId: string,\n    message: AdapterPostableMessage,\n    options: {\n      replyTo?: string;\n      replaceMessageId?: string;\n      retryUnknown?: boolean;\n      assertCurrent(): Promise<void>;\n    },","sourceCodeStart":374,"sourceCodeEnd":410,"githubUrl":"https://github.com/paperclipai/paperclip/blob/3f1d897a7c018d76563a21c6e39c3c9b03933622/server/src/services/photon/adapter.ts#L374-L410","documentation":"Photon's deleteMessage is deliberately unimplemented: it always throws 'Photon message deletion is not supported'. Published Photon messages are treated as immutable receipts; deletion is intentionally absent from the adapter's capability surface.","triggerScenarios":"Any call to adapter.deleteMessage() on the Photon adapter.","commonSituations":"Generic cleanup/redaction code that deletes messages on every adapter; GDPR-style removal workflows applied uniformly across messaging adapters.","solutions":["Do not delete Photon messages; they are immutable publication receipts by design.","Gate deletion behind an adapter capability check and skip Photon.","If removal is required, handle it at the Paperclip publication layer rather than via the Photon adapter."],"exampleFix":"// before\nawait adapter.deleteMessage();\n// after\nif (adapter.capabilities?.canDelete) {\n  await adapter.deleteMessage();\n} // else: deletion unsupported (Photon)\n","handlingStrategy":"type-guard","validationCode":"if (!adapter.capabilities?.canDelete) return; // Photon deletion unsupported","typeGuard":"const canDelete = (a: unknown): a is AdapterWithDelete => (a as AdapterWithDelete).capabilities?.canDelete === true;","tryCatchPattern":"try {\n  await adapter.deleteMessage();\n} catch (e) {\n  if (e.message.includes(\"deletion is not supported\")) return; // Photon messages are immutable\n  throw e;\n}","preventionTips":["Treat published Photon messages as immutable receipts in cleanup workflows.","Consult adapter capability flags before generic delete/redaction passes.","Perform removal obligations at the Paperclip layer, not via the Photon adapter."],"tags":["photon","messaging","unsupported-operation"],"backgroundTag":"method-not-implemented","analyzedSha":"3f1d897a7c018d76563a21c6e39c3c9b03933622","analyzedAt":"2026-09-18T08:03:59.046Z","contentChangedAt":"2026-09-18T08:03:59.046Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}