mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 21:53:00 -06:00
ci: consolidate SMS webhook test reset (#106070)
* ci: clear stale dead-export surfaces * ci: align dead-export baseline
This commit is contained in:
committed by
GitHub
parent
db252ac417
commit
807491e0f1
@@ -7,7 +7,6 @@ import { computeTwilioSignature, parseTwilioFormBody } from "./twilio.js";
|
||||
import type { ResolvedSmsAccount } from "./types.js";
|
||||
import {
|
||||
createSmsWebhookHandler,
|
||||
resetSmsWebhookRateLimiterForTest,
|
||||
createSmsWebhookReplayGuard,
|
||||
resetSmsWebhookReplayGuardsForTest,
|
||||
} from "./webhook.js";
|
||||
@@ -116,7 +115,6 @@ function createMessageSid(index: number): string {
|
||||
describe("createSmsWebhookHandler", () => {
|
||||
beforeEach(() => {
|
||||
dispatchSmsInboundEvent.mockClear();
|
||||
resetSmsWebhookRateLimiterForTest();
|
||||
resetSmsWebhookReplayGuardsForTest();
|
||||
});
|
||||
|
||||
|
||||
@@ -104,6 +104,8 @@ function resolveSmsWebhookReplayGuard(account: ResolvedSmsAccount): SmsWebhookRe
|
||||
|
||||
export function resetSmsWebhookReplayGuardsForTest(): void {
|
||||
replayGuardsByAccount.clear();
|
||||
invalidRequestRateLimiter.clear();
|
||||
callbackDispatchRateLimiter.clear();
|
||||
}
|
||||
|
||||
type SmsWebhookLog = {
|
||||
@@ -152,11 +154,6 @@ function rejectInvalidRequestRateLimit(params: {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function resetSmsWebhookRateLimiterForTest(): void {
|
||||
invalidRequestRateLimiter.clear();
|
||||
callbackDispatchRateLimiter.clear();
|
||||
}
|
||||
|
||||
// Each account route owns its guard so one saturated account cannot block sibling accounts.
|
||||
export function createSmsWebhookHandler(
|
||||
params: SmsWebhookHandlerParams,
|
||||
|
||||
@@ -1018,7 +1018,6 @@ export const KNIP_UNUSED_EXPORT_BASELINE = [
|
||||
"extensions/sms/src/twilio.ts: parseTwilioFormBody",
|
||||
"extensions/sms/src/twilio.ts: TwilioSmsApiError",
|
||||
"extensions/sms/src/webhook.ts: createSmsWebhookReplayGuard",
|
||||
"extensions/sms/src/webhook.ts: resetSmsWebhookRateLimiterForTest",
|
||||
"extensions/sms/src/webhook.ts: resetSmsWebhookReplayGuardsForTest",
|
||||
"extensions/synology-chat/src/channel.ts: createSynologyChatPlugin",
|
||||
"extensions/synology-chat/src/channel.ts: synologyChatMessageAdapter",
|
||||
|
||||
Reference in New Issue
Block a user