mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-02 11:01:34 +00:00
refactor(discord): deprecate abort signal helper (#109166)
This commit is contained in:
committed by
GitHub
parent
813021fa79
commit
14bb0b4e52
@@ -1,6 +1,7 @@
|
||||
// Discord tests cover timeouts plugin behavior.
|
||||
import { MAX_TIMER_TIMEOUT_MS } from "openclaw/plugin-sdk/number-runtime";
|
||||
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||
import { mergeAbortSignals as publicApiMergeAbortSignals } from "../../api.js";
|
||||
import {
|
||||
isAbortError as runtimeApiIsAbortError,
|
||||
mergeAbortSignals as runtimeApiMergeAbortSignals,
|
||||
@@ -26,7 +27,8 @@ afterEach(() => {
|
||||
});
|
||||
|
||||
describe("discord monitor timeouts", () => {
|
||||
it("keeps deprecated timeout helpers on the runtime api compatibility surface", () => {
|
||||
it("keeps deprecated timeout helpers on shipped compatibility surfaces", () => {
|
||||
expect(publicApiMergeAbortSignals).toBe(mergeAbortSignals);
|
||||
expect(runtimeApiIsAbortError).toBe(isAbortError);
|
||||
expect(runtimeApiMergeAbortSignals).toBe(mergeAbortSignals);
|
||||
expect(runtimeApiNormalizeDiscordInboundWorkerTimeoutMs).toBe(
|
||||
|
||||
@@ -38,6 +38,7 @@ export function isAbortError(error: unknown): boolean {
|
||||
return "name" in error && String((error as { name?: unknown }).name) === "AbortError";
|
||||
}
|
||||
|
||||
/** @deprecated Use native `AbortSignal.any` after filtering optional signals at the call site. */
|
||||
export function mergeAbortSignals(
|
||||
signals: Array<AbortSignal | undefined>,
|
||||
): AbortSignal | undefined {
|
||||
|
||||
Reference in New Issue
Block a user