From d37f05c3bc8fd5153bf7f5b8ae527e816a9acdf7 Mon Sep 17 00:00:00 2001 From: Jan Leon Date: Mon, 29 Jun 2026 17:18:36 +0200 Subject: [PATCH] chore: remove unused settings fallback schema (#5368) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Integrated into release/v3.8.41 — dead-code removal (typecheck:core EXIT 0, 70 affected tests green, fabricated-docs clean). Thanks @JxnLexn. --- src/shared/validation/schemas/settings.ts | 10 +--------- tests/unit/settings-schema-routing-strategies.test.ts | 5 +++++ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/shared/validation/schemas/settings.ts b/src/shared/validation/schemas/settings.ts index 21a30fb3a7..9fdd8b6caa 100644 --- a/src/shared/validation/schemas/settings.ts +++ b/src/shared/validation/schemas/settings.ts @@ -1,8 +1,5 @@ import { z } from "zod"; -import { - ACCOUNT_FALLBACK_STRATEGY_VALUES, - ROUTING_STRATEGY_VALUES, -} from "@/shared/constants/routingStrategies"; +import { ROUTING_STRATEGY_VALUES } from "@/shared/constants/routingStrategies"; import { SUPPORTED_BATCH_ENDPOINTS } from "@/shared/constants/batchEndpoints"; import { MAX_REQUEST_BODY_LIMIT_MB, MIN_REQUEST_BODY_LIMIT_MB } from "@/shared/constants/bodySize"; import { COMBO_CONFIG_MODES } from "@/shared/constants/comboConfigMode"; @@ -15,11 +12,6 @@ import { } from "@/shared/constants/upstreamHeaders"; import { MAX_TIMER_TIMEOUT_MS } from "@/shared/utils/runtimeTimeouts"; -// ──── Settings Schemas ──── -// FASE-01: Removed .passthrough() — only explicitly listed fields are accepted - -export const settingsFallbackStrategySchema = z.enum(ACCOUNT_FALLBACK_STRATEGY_VALUES); - // Single source of truth: ../settingsSchemas (the schema the runtime settings route validates // against). Re-exported here so this modular barrel stays in exact lockstep — a divergent local // copy (introduced by the #3988 lossy modularization) silently dropped 40 fields while gaining a diff --git a/tests/unit/settings-schema-routing-strategies.test.ts b/tests/unit/settings-schema-routing-strategies.test.ts index 04b94523a4..964fe19e6b 100644 --- a/tests/unit/settings-schema-routing-strategies.test.ts +++ b/tests/unit/settings-schema-routing-strategies.test.ts @@ -2,6 +2,7 @@ import test from "node:test"; import assert from "node:assert/strict"; import { SETTINGS_FALLBACK_STRATEGY_VALUES } from "@/shared/constants/routingStrategies"; import { updateSettingsSchema as settingsRouteSchema } from "@/shared/validation/settingsSchemas"; +import * as sharedSchemaModule from "@/shared/validation/schemas"; import { updateSettingsSchema as sharedSettingsSchema } from "@/shared/validation/schemas"; for (const strategy of SETTINGS_FALLBACK_STRATEGY_VALUES) { @@ -23,6 +24,10 @@ test("settings schemas reject combo-only strategies as account fallback strategi } }); +test("shared settings schema module omits the unused fallback strategy sub-schema export", () => { + assert.equal("settingsFallbackStrategySchema" in sharedSchemaModule, false); +}); + test("settings schemas accept cooldown-aware retry knobs", () => { const payload = { requestRetry: 3,