refactor: consolidate throwIfAborted + fix isCompactionFailureError (#12463)

* refactor: consolidate throwIfAborted in outbound module

- Create abort.ts with shared throwIfAborted helper

- Update deliver.ts, message-action-runner.ts, outbound-send-service.ts

* fix: handle context overflow in isCompactionFailureError without requiring colon
This commit is contained in:
max
2026-02-09 00:32:57 -08:00
committed by GitHub
parent f0924d3c4e
commit 79c2466662
6 changed files with 27 additions and 29 deletions

View File

@@ -28,6 +28,7 @@ import {
type GatewayClientName,
} from "../../utils/message-channel.js";
import { loadWebMedia } from "../../web/media.js";
import { throwIfAborted } from "./abort.js";
import {
listConfiguredMessageChannels,
resolveMessageChannelSelection,
@@ -720,14 +721,6 @@ async function handleBroadcastAction(
};
}
function throwIfAborted(abortSignal?: AbortSignal): void {
if (abortSignal?.aborted) {
const err = new Error("Message send aborted");
err.name = "AbortError";
throw err;
}
}
async function handleSendAction(ctx: ResolvedActionContext): Promise<MessageActionRunResult> {
const {
cfg,