Skip to content

fix(compression): cache TTL input stops at the 1-60 minutes the route accepts - #14766

Merged
diegosouzapw merged 3 commits into
diegosouzapw:release/v3.8.51from
woodsonl:fix/compression-cache-ttl-bounds
Sep 29, 2026
Merged

diegosouzapw merged 3 commits into
diegosouzapw:release/v3.8.51from
woodsonl:fix/compression-cache-ttl-bounds

Conversation

@woodsonl

@woodsonl woodsonl commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ base-red inherited: #14547, #14496

Summary

The cache TTL input in the compression settings tab (CompressionSettingsTab.tsx) was bounded min={0} max={1440}. PUT /api/settings/compression validates its body with compressionSettingsUpdateSchema, where cacheMinutes is an integer from 1 to 60, and the live-zone cache clamps the TTL it receives to the same 1 to 60 (open-sse/services/compression/liveZone.ts:264). The input's spinner therefore walked into values the route rejects with 400: 61 to 1440 at the top, and 0 at the bottom.

The input now uses min={1} max={60}.

Related Issues

The Fix

  • min={0} becomes min={1} and max={1440} becomes max={60} on the cache TTL input.

Validation

  • Change type: UI
  • Focused tests and category gates from the golden path
  • npm run lint
  • Reconciled with the current active release base; focused checks rerun afterward
  • Production-code changes include a new or updated automated test in this PR
Check Result
New test on the base code (commit 3fa9d9b adds only the test) 2 of 2 fail
New test plus the two sibling suites that render the tab (compression-settings-tab-consolidation, compression-settings-page) 9/9 pass
Mutations of the fixed bounds (max set to 59 or 61, min set to 0 or 2) each run fails the case for that bound
npm run check:dashboard-typecheck OK: 197 pre-existing errors, all within the frozen baseline
ESLint on the two changed files, with the repo suppressions 0 problems
Prettier on the two changed files clean
Full npm run lint not run locally; the CI lint job runs it
git merge-tree against the #14723 head (fab0a77921) clean

The branch starts at 4e77ceb9ab, the tip of release/v3.8.51 when the branch was cut.

Red CI Checks Came From The Base

The five red checks come from Quality Gates run 36019753265, which tested this PR merged onto base commit ce11dda618. #14774 was tested on the same base commit in run 36021626241 and fails the same checks and tests. #14774 changes open-sse executor and service code, two unit tests and a changelog fragment.

Check on this PR What fails Same failure on #14774
Docs Gates (fast-path) check:docs-counts (✗ 3 STRICT drift(s) detected): the code has 185 DB migrations, and README.md, AGENTS.md and llm.txt say 183 Docs Gates (fast-path)
Fast Quality Gates mutation-test-coverage: 1 covering unit test(s) across 1 module(s) are missing from stryker.conf.json tap.testFiles (tests/unit/claude-passthrough-empty-response.test.ts for passthroughHelpers.ts) Fast Quality Gates
Unit Tests fast-path (2/4) check-docs-counts-sync.test.ts (the same migration count), two zh-TW glossary tests in i18n-glossary-consistency-check.test.ts, and findMissingArtifactPaths flags missing root runtime files in the tarball Unit Tests fast-path (2/4), Unit Tests fast-path (3/4)
Unit Tests fast-path (3/4) MCP server bundle imports successfully on Node 24 and English sidebar translations include every configured sidebar item Unit Tests fast-path (3/4), Unit Tests fast-path (4/4)
Unit Tests fast-path (4/4) executeWithUpstreamStartTimeout leaves no abort listener on the client signal after a resolving execute, four pre-content streaming-quality tests, and a fetch still running when the dispatch returns does not change the status Unit Tests fast-path (4/4), Unit Tests fast-path (1/4)

Some tests ran in a different shard on #14774; each link points to the shard where the test failed.

The new .tsx test runs under vitest.config.ts (npm run test:vitest:ui). The unit shards run .test.ts and .test.mjs files (test:unit:ci:shard in package.json), and Vitest (fast-path) runs vitest.mcp.config.ts. After the merge, the release PR #11442 ran the new test on a head that contains this change, in Vitest (MCP / autoCombo / UI components): ✓ tests/unit/ui/compression-settings-tab-cache-ttl-bounds.test.tsx (2 tests).

#14547, the base-red issue named at the top of this description, closed on September 25, 2026, after #14778 synced the migration count.

Tests Added Or Updated

tests/unit/ui/compression-settings-tab-cache-ttl-bounds.test.tsx (new) renders the tab with the harness from compression-settings-tab-consolidation.test.tsx, reads min and max off the cache TTL input, and checks each against compressionSettingsUpdateSchema:

  1. The route accepts the input's min and rejects min - 1.
  2. The route accepts the input's max and rejects max + 1.

The test holds no bound values of its own. It reads them from the rendered input and the schema, so a change to either side alone fails it.

Coverage Notes

  • The two cases cover the cache TTL input's min and max in CompressionSettingsTab.tsx. The existing tab tests still pass.
  • These .tsx tests run under vitest.config.ts (npm run test:vitest:ui, the test-vitest CI job).

Reviewer Notes

The settings tab's cache TTL input offers 0 to 1440 minutes, while PUT /api/settings/compression accepts 1 to 60, so the spinner produces values the route rejects with 400. The test reads min and max off the rendered input and checks each against compressionSettingsUpdateSchema. Both cases fail on the current input bounds.
The settings tab's cache TTL input offered 0 to 1440 minutes. compressionSettingsUpdateSchema accepts 1 to 60, and the live-zone cache clamps its TTL to the same 1 to 60 (liveZone.ts), so any value above 60 from the input made the save fail with 400. The input now offers 1 to 60.
@diegosouzapw

Copy link
Copy Markdown
Owner

Thanks, clean and well-scoped fix. The bounds now match the route's schema and the two tests fail without the change. Good to merge.

@diegosouzapw
diegosouzapw merged commit 866191f into diegosouzapw:release/v3.8.51 Sep 29, 2026
11 of 16 checks passed
@woodsonl
woodsonl deleted the fix/compression-cache-ttl-bounds branch September 29, 2026 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants