mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-25 03:45:46 -06:00
fix(discord): release PluralKit 404 bodies (#109960)
This commit is contained in:
@@ -59,13 +59,15 @@ describe("fetchPluralKitMessageInfo", () => {
|
||||
});
|
||||
|
||||
it("returns null on 404", async () => {
|
||||
const fetcher = vi.fn(async () => buildResponse({ status: 404 }));
|
||||
const tracked = cancelTrackedResponse("missing", { status: 404 });
|
||||
const fetcher = vi.fn(async () => tracked.response);
|
||||
const result = await fetchPluralKitMessageInfo({
|
||||
messageId: "missing",
|
||||
config: { enabled: true },
|
||||
fetcher: fetcher as unknown as typeof fetch,
|
||||
});
|
||||
expect(result).toBeNull();
|
||||
expect(tracked.wasCanceled()).toBe(true);
|
||||
});
|
||||
|
||||
it("returns payload and sends token when configured", async () => {
|
||||
|
||||
@@ -65,6 +65,7 @@ export async function fetchPluralKitMessageInfo(params: {
|
||||
signal: timeout.signal,
|
||||
});
|
||||
if (res.status === 404) {
|
||||
await res.body?.cancel().catch(() => undefined);
|
||||
return null;
|
||||
}
|
||||
if (!res.ok) {
|
||||
|
||||
Reference in New Issue
Block a user