fix(compression): cache TTL input stops at the 1-60 minutes the route accepts - #14766
Merged
diegosouzapw merged 3 commits intoSep 29, 2026
Conversation
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.
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
merged commit Sep 29, 2026
866191f
into
diegosouzapw:release/v3.8.51
11 of 16 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The cache TTL input in the compression settings tab (
CompressionSettingsTab.tsx) was boundedmin={0} max={1440}.PUT /api/settings/compressionvalidates its body withcompressionSettingsUpdateSchema, wherecacheMinutesis 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
save()in the same file to send only the fields that changed and to roll back a failed save. Its reviewer notes name this bound mismatch as a separate change. fix(compression): settings tab saves only the fields that changed #14723 changes the import line and lines 215 to 259 of the base file; this PR changes lines 393 and 394. Agit merge-treeof the two heads is clean, so they merge in either order.The Fix
min={0}becomesmin={1}andmax={1440}becomesmax={60}on the cache TTL input.Validation
npm run lintcompression-settings-tab-consolidation,compression-settings-page)maxset to 59 or 61,minset to 0 or 2)npm run check:dashboard-typechecknpm run lintlintjob runs itgit merge-treeagainst the #14723 head (fab0a77921)The branch starts at
4e77ceb9ab, the tip ofrelease/v3.8.51when 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 changesopen-sseexecutor and service code, two unit tests and a changelog fragment.check:docs-counts(✗ 3 STRICT drift(s) detected): the code has 185 DB migrations, andREADME.md,AGENTS.mdandllm.txtsay 183mutation-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.tsforpassthroughHelpers.ts)check-docs-counts-sync.test.ts(the same migration count), two zh-TW glossary tests ini18n-glossary-consistency-check.test.ts, andfindMissingArtifactPaths flags missing root runtime files in the tarballMCP server bundle imports successfully on Node 24andEnglish sidebar translations include every configured sidebar itemexecuteWithUpstreamStartTimeout leaves no abort listener on the client signal after a resolving execute, four pre-content streaming-quality tests, anda fetch still running when the dispatch returns does not change the statusSome tests ran in a different shard on #14774; each link points to the shard where the test failed.
The new
.tsxtest runs undervitest.config.ts(npm run test:vitest:ui). The unit shards run.test.tsand.test.mjsfiles (test:unit:ci:shardinpackage.json), and Vitest (fast-path) runsvitest.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 fromcompression-settings-tab-consolidation.test.tsx, readsminandmaxoff the cache TTL input, and checks each againstcompressionSettingsUpdateSchema:minand rejectsmin - 1.maxand rejectsmax + 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
minandmaxinCompressionSettingsTab.tsx. The existing tab tests still pass..tsxtests run undervitest.config.ts(npm run test:vitest:ui, thetest-vitestCI job).Reviewer Notes
onChangekeeps its|| 5fallback, so clearing the field or typing 0 saves 5, as before.src/lib/db/compression.tsfloorscacheMinutesat 1 and sets no ceiling. Its only runtime reader, the live-zone cache (chatCore.tspasses it asttlMinutes), caps the TTL at 60.