From 5f0baea4ee2a33e2d09290acb882ce7657f86268 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 22 Jun 2026 21:07:22 +0000 Subject: [PATCH] =?UTF-8?q?fix(sdk):=20drop=20Message.blockedReason=20?= =?UTF-8?q?=E2=80=94=20abuse=20reason=20is=20operator-only?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit senderkit-app #211 ("keep spam-detection detail out of customer-visible surfaces") confirms the outbound abuse scanner's detailed block reason is operator-only: the customer-facing message read columns omit `blockedReason` entirely, and a blocked message surfaces only a generic `blocked` entry on its timeline. The field added in the prior sync would never be populated via the public API, so remove `Message.blockedReason` and correct the `Message.status` and `MESSAGE_STATUSES` docs. The `blocked` status itself is unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_01ACZUdzMZGZFNjwfSZ42E2u --- .changeset/cool-cups-clap.md | 13 +++++++++++++ packages/sdk/src/mcp-schemas.ts | 3 ++- packages/sdk/src/types.ts | 6 +++--- 3 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 .changeset/cool-cups-clap.md diff --git a/.changeset/cool-cups-clap.md b/.changeset/cool-cups-clap.md new file mode 100644 index 0000000..b89c153 --- /dev/null +++ b/.changeset/cool-cups-clap.md @@ -0,0 +1,13 @@ +--- +"@senderkit/sdk": patch +"@senderkit/cli": patch +--- + +Drop the `Message.blockedReason` field. senderkit-app (#211) confirmed the +abuse scanner's detailed block reason is operator-only and is never returned +by the public messages API — customer-facing reads omit the column entirely +and a `blocked` message exposes only a generic `blocked` entry on its +`timeline`. The previously-added `blockedReason` field would therefore never +be populated, so it has been removed and the `Message.status` / +`MESSAGE_STATUSES` docs updated to match. The `blocked` status itself is +unchanged. diff --git a/packages/sdk/src/mcp-schemas.ts b/packages/sdk/src/mcp-schemas.ts index 0dec5e3..32c9932 100644 --- a/packages/sdk/src/mcp-schemas.ts +++ b/packages/sdk/src/mcp-schemas.ts @@ -122,7 +122,8 @@ const emailEnvelope = { * The ten message lifecycle statuses (mirrors the app's `messageStatusEnum`). * Bounces normalize to `failed` with the reason on the message timeline. * `blocked` is a terminal state set when the outbound abuse scanner halts a - * send (the human-readable trigger is on the message's `blockedReason`). + * send. The detailed trigger is operator-only and is never returned by the + * API; the message carries only a generic `blocked` entry on its timeline. */ export const MESSAGE_STATUSES = [ "scheduled", diff --git a/packages/sdk/src/types.ts b/packages/sdk/src/types.ts index a3345e7..d3dd05b 100644 --- a/packages/sdk/src/types.ts +++ b/packages/sdk/src/types.ts @@ -195,15 +195,15 @@ export interface Message { publicId: string; /** * Lifecycle status (one of `MESSAGE_STATUSES`). A `blocked` message was - * halted by the outbound abuse scanner; `blockedReason` carries the trigger. + * halted by the outbound abuse scanner. The detailed trigger is operator-only + * and is never returned by the API; the message carries only a generic + * `blocked` entry on its `timeline`. */ status: string; channel: Channel; templateSlug: string | null; recipient: string; createdAt: string; - /** Human-readable reason a `blocked` message was halted. Absent otherwise. */ - blockedReason?: string | null; [key: string]: unknown; }