ci: consolidate SMS webhook test reset (#106070)

* ci: clear stale dead-export surfaces

* ci: align dead-export baseline
This commit is contained in:
Peter Steinberger
2026-07-12 22:41:35 -07:00
committed by GitHub
parent db252ac417
commit 807491e0f1
3 changed files with 2 additions and 8 deletions
-2
View File
@@ -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();
});
+2 -5
View File
@@ -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,
-1
View File
@@ -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",