paperclipai/paperclip · error

Photon message deletion is not supported

Error message

Photon message deletion is not supported

What it means

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.

Solutions

  1. Do not delete Photon messages; they are immutable publication receipts by design.
  2. Gate deletion behind an adapter capability check and skip Photon.
  3. If removal is required, handle it at the Paperclip publication layer rather than via the Photon adapter.

Example fix

// before
await adapter.deleteMessage();
// after
if (adapter.capabilities?.canDelete) {
  await adapter.deleteMessage();
} // else: deletion unsupported (Photon)
Defensive patterns

Strategy: type-guard

Validate before calling

if (!adapter.capabilities?.canDelete) return; // Photon deletion unsupported

Type guard

const canDelete = (a: unknown): a is AdapterWithDelete => (a as AdapterWithDelete).capabilities?.canDelete === true;

Try / catch

try {
  await adapter.deleteMessage();
} catch (e) {
  if (e.message.includes("deletion is not supported")) return; // Photon messages are immutable
  throw e;
}

Prevention

When it happens

Trigger: Any call to adapter.deleteMessage() on the Photon adapter.

Common situations: Generic cleanup/redaction code that deletes messages on every adapter; GDPR-style removal workflows applied uniformly across messaging adapters.

Related errors


AI-assisted analysis of paperclipai/paperclip@3f1d897a7c (2026-09-18). Data as JSON: /api/errors/cd9ba3b3b2ab2a76. Report an issue: GitHub.

Appendix: source

Thrown at server/src/services/photon/adapter.ts:392

  async postMessage(
    _id: string,
    _message: AdapterPostableMessage,
  ): Promise<never> {
    throw new Error(
      "Photon sends require an immutable Paperclip publication identity",
    );
  }
  async editMessage(
    _id: string,
    _messageId: string,
    _message: AdapterPostableMessage,
  ): Promise<never> {
    throw new Error(
      "Photon edits require an immutable Paperclip publication identity",
    );
  }
  async deleteMessage(): Promise<never> {
    throw new Error("Photon message deletion is not supported");
  }
  async addReaction(): Promise<void> {
    /* Receipt reactions are intentionally not published. */
  }
  async removeReaction(): Promise<void> {
    /* Reactions never represent approvals. */
  }

  async publish(
    id: string,
    publicationId: string,
    message: AdapterPostableMessage,
    options: {
      replyTo?: string;
      replaceMessageId?: string;
      retryUnknown?: boolean;
      assertCurrent(): Promise<void>;
    },

View on GitHub (pinned to 3f1d897a7c)