Repository navigation
chore(deps): update tower-http to 0.7.1 - #41
Conversation
The owner wants every dependency on its latest version. The lead accepts a temporary second tower-http copy: reqwest 0.13.5 still depends on tower-http 0.6, and deny.toml only warns on duplicates. reqwest master already uses 0.7.1 (seanmonstar/reqwest#3062). STACK.md §6 records the duplicate and its removal condition. The server uses only the fs feature (ServeDir, ServeFile). Two changes of 0.7 alter its answers, so new integration tests pin them: - ServeDir and ServeFile send a strong ETag and answer If-None-Match (304) and If-Match (412). index.html keeps no-cache. - A file path with a trailing slash is 404 and is not the file. A third test keeps the range behaviour: one range is 206, a multipart range request is 416. On tower-http 0.6.11 the first two tests fail and the range test passes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tower-http 0.7 (#691) answers a stale If-Match with 412 and no body. tower-http 0.6.11 ignored If-Match and sent 200. The ETag test checked If-Match only after its first ETag assertion, so that test could not show the If-Match change on 0.6.11 by itself. A separate test now covers a bundle and index.html. On 0.6.11 it fails with 200 instead of 412. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jonikanerva
left a comment
There was a problem hiding this comment.
Verdict: FAIL
Summary
The version change is correct, and mise run verify passes on the PR head. The PR fails on missing required evidence, not on a product defect. The task requires a test that fails on tower-http 0.6.11 for each 0.7.0 and 0.7.1 behaviour change that reaches the server. The PR criterion "New tests cover each changed behaviour" says the same. Reviewer challenge tests found five behaviour changes that reach the server, differ between 0.6.11 and 0.7.1, and have no PR test. One changelog mapping row is also wrong.
What passes
tower-http =0.7.1is the latest stable release.Cargo.lockadds onlytower-http0.7.1. reqwest 0.13.5 keeps 0.6.11.deny.tomlhasmultiple-versions = "warn", socargo denywarns about the duplicate and does not fail.STACK.md§6 records the duplicate and the condition to remove it. This agrees with the lead decision.- The changelog table agrees with
CHANGELOG.mdof the 0.7.1 crate, except for the #686 row (finding 2). - The
try_callclaim is correct. In 0.7.1,Service::callmaps a not-found I/O error to 404 and other errors to 500.found()treats both as "not found". - The four PR tests fail on 0.6.11 for the stated reasons.
the_client_build_sends_a_strong_etagfails at theexpect("an ETag")line.the_client_build_refuses_a_stale_if_matchgets 200, not 412.the_client_build_has_no_file_for_a_path_with_a_trailing_slashgets 200, not 404.the_client_build_serves_one_byte_rangepasses on both versions, as the PR says.
Blocking findings
1. Changed behaviour without a test that fails on 0.6.11
Location: crates/server/tests/integration/api_security.rs. The reviewer added scratch tests to an isolated clone. The tests are not published. Each test below passes on 0.7.1 (PR head) and fails on 0.6.11 (Cargo.toml and Cargo.lock of main). Each one is a behaviour that no PR test checks.
| Reviewer test | Request | 0.6.11 | 0.7.1 |
|---|---|---|---|
rv_inm_mismatch_overrides_ims |
bundle, If-None-Match: "nomatch" and If-Modified-Since: <Last-Modified> |
304 | 200 |
rv_304_from_ims_carries_last_modified |
bundle, If-Modified-Since: <Last-Modified> |
304 without Last-Modified |
304 with Last-Modified |
rv_unsatisfiable_range_has_no_content_type |
bundle, Range: bytes=100-200 |
416 with Content-Type: text/javascript; charset=utf-8 |
416 without Content-Type |
rv_identity_encoding_does_not_strip_extension |
/assets/index-abc.js.map and /index.html.bak, Accept-Encoding: identity |
200 (the bundle and index.html) |
404 |
rv_trailing_slash_with_html_gets_index |
/favicon.png/, Accept: text/html |
200 with the favicon | 200 with index.html |
The reviewer also tested rv_deep_link_stale_if_match_412: /settings with Accept: text/html and If-Match: "stale" gets 200 on 0.6.11 and 412 on 0.7.1. The PR describes this answer but does not test it. The deep-link path uses a different code path (ServeDir 404, then the ServeFile fallback with the copied headers). A test for this path is recommended. It is not counted as a separate blocking item.
Impact: the PR criterion and the task requirement are not met. The precedence change (If-None-Match overrides If-Modified-Since) is not in the PR mapping. Browsers send both headers when they revalidate, so this change is on the real revalidation path. The PR table lists the 416 Content-Type change and the 304 Last-Modified change, but no test checks them.
Minimum fix: add integration tests that pin these answers on 0.7.1, then repeat the detection check on 0.6.11. Name each test and its 0.6.11 result in the PR body.
Verify: each new test passes on the head and fails on 0.6.11.
2. Wrong mapping for tower-http #686
Location: PR body, 0.7.0 table, row "fs: ServeDir no longer strips the file extension with identity encoding". The row says "None visible. Precompression is not configured."
Evidence: in 0.6.11, Encoding::parse accepts identity without precompression (content_encoding.rs). Then open_file_with_fallback calls path.set_extension("") after NotFound, and opens the file again. So on 0.6.11, GET /assets/index-abc.js.map with Accept-Encoding: identity sends the JS bundle with 200. GET /index.html.bak sends index.html. On 0.7.1 both requests are 404 (encoding != Encoding::Identity guard). The reviewer test rv_identity_encoding_does_not_strip_extension shows this result.
Impact: the change-to-effect mapping, a PR criterion, is wrong for this row. The change is a fix, but it reaches the server.
Minimum fix: correct the row and add the test from finding 1.
Verification
- PR head:
8894b3013bcada716598e6ec202a7994d52d40f2. Basemain:2478fcaf1355a484ffa7845eced3b34a1a2e4afb. The base is an ancestor of the head, so the tested commit is the head. Tree:bd9b68e195aee40c96c532f93e2ae1024fb36a5a. - Environment: a fresh clone in a temporary directory, macOS arm64, mise toolchain (Rust from
rust-toolchain.toml, Node 26.13.1, pnpm 12.21.0), Dockerpostgres:18through OrbStack on 127.0.0.1:55473. mise run setup && mise run verify: exit 0, 2026-11-15 13:14 to 13:31 UTC. nextest 202 of 202 passed. Doctests passed. Vitest 19 and 4 passed. Playwright 67 passed.cargo denywarns abouttower-http0.6.11 and 0.7.1 and does not fail.git statusis clean after verify.- Detection run:
cargo nextest run -p caltodo --test integration --no-fail-fast -E 'test(/client_build|rv_/)'on the head (12 of 12 passed). The same command ran on the head withCargo.tomlandCargo.lockofmain(tower-http 0.6.11). Results on 0.6.11: the three new PR tests failed, as stated in the PR. The range test and the deep-link test passed. All reviewer tests except the version-neutral checks failed, as in the table above. - The repository has no CI pipeline (
STACK.md§14). No required CI check exists. - The reviewer stopped the
caltodo-pgcontainer after the runs.
Limitations
- The reviewer did not check the Railway build or the production answers. The production
ETagcomes from size and modification time inside the image. Before this PR,If-Modified-Sincealso used the modification time, so this PR adds no new stale-cache risk. - This verdict is not owner approval.
Review round 1 of PR #41 found six behaviour changes of tower-http 0.7 without a test. Each new test passes on 0.7.1 and fails on 0.6.11: - A wrong If-None-Match with a current If-Modified-Since is 200 (was 304). - A 304 answer to If-Modified-Since carries Last-Modified (was absent). - A 416 answer has no Content-Type (was the file type). - With Accept-Encoding: identity, index-abc.js.map and index.html.bak are 404 (0.6.11 stripped the last extension and served the file). - /favicon.png/ with Accept: text/html gets index.html (was the file). - A deep link with a stale If-Match is 412 (was index.html). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jonikanerva
left a comment
There was a problem hiding this comment.
Verdict: PASS
Summary
Round 2 reviews head 46d37e5. The new commit adds six integration tests for the round 1 findings. The PR body now has a correct #686 row and a complete list of the behaviour changes. Each 0.7.0 and 0.7.1 behaviour change that reaches the server now has a test that fails on tower-http 0.6.11 and passes on 0.7.1. mise run verify passes on the head. The reviewer found no blocking findings.
Round 1 findings
| Round 1 finding | New test | Result on 0.6.11 | Result on 0.7.1 |
|---|---|---|---|
If-None-Match takes precedence over If-Modified-Since |
the_client_build_prefers_if_none_match_to_if_modified_since |
FAIL: 304, expected 200 | PASS |
A 304 answer carries Last-Modified |
the_client_build_sends_last_modified_on_a_304 |
FAIL: no Last-Modified |
PASS |
A 416 answer has no Content-Type |
the_client_build_sends_no_content_type_on_a_416 |
FAIL: text/javascript; charset=utf-8 |
PASS |
#686: no extension strip with Accept-Encoding: identity |
the_client_build_keeps_the_extension_with_identity_encoding |
FAIL: 200, expected 404 | PASS |
/favicon.png/ with Accept: text/html gets index.html |
a_file_path_with_a_trailing_slash_is_a_deep_link |
FAIL: the body is not index.html |
PASS |
A deep link with a stale If-Match is 412 |
a_deep_link_refuses_a_stale_if_match |
FAIL: 200, expected 412 | PASS |
The three earlier tests still fail on 0.6.11 for the stated reasons: the_client_build_sends_a_strong_etag (no ETag), the_client_build_refuses_a_stale_if_match (200, expected 412), and the_client_build_has_no_file_for_a_path_with_a_trailing_slash (200, expected 404). the_client_build_serves_one_byte_range and the_client_build_serves_deep_links_but_not_api_paths pass on both versions. These two tests guard behaviour that did not change.
The new tests check the same answers as the reviewer challenge tests of round 1. The PR body describes each test with its 0.6.11 result, and these results agree with the reviewer run. The commit changes only crates/server/tests/integration/api_security.rs. No product code changed after round 1.
Verification
- PR head:
46d37e5e17e2440e6c1ff551cab798527e4648db. Basemain:2478fcaf1355a484ffa7845eced3b34a1a2e4afb. The base is an ancestor of the head, so the tested commit is the head. Tree:ec4ebecfdd11698d9e2bea2ae02a251e809c8b3f. - Environment: an isolated clone in a temporary directory, macOS arm64, mise toolchain (Rust from
rust-toolchain.toml, Node 26.13.1, pnpm 12.21.0), Dockerpostgres:18through OrbStack on 127.0.0.1:55473. mise run setup && mise run verify: exit 0, 2026-11-15 13:59 to 14:07 UTC. Results: nextest 208 of 208 passed, doctests passed, Vitest 19 and 4 passed, and Playwright 67 passed.cargo denywarns abouttower-http0.6.11 and 0.7.1 and does not fail (multiple-versions = "warn").git statusis clean after verify.- Detection run: the head with
Cargo.tomlandCargo.lockofmain(tower-http 0.6.11). Command:cargo nextest run -p caltodo --test integration --no-fail-fast -E 'test(/client_build|trailing_slash|deep_link/)'. Result: 11 tests run, 9 failed as in the table above, 2 passed (the two tests that guard unchanged behaviour). - The repository has no CI pipeline (
STACK.md§14). No required CI check exists. - The temporary second copy of tower-http 0.6.11 through reqwest 0.13.5 agrees with the lead decision.
STACK.md§6 records the copy and the condition to remove it.
Limitations
- The reviewer did not check the Railway build or the production answers. The
STACK.md§15 release checks stay pending until the merge. - This verdict is not owner approval. The owner merges.
Summary
This PR updates
tower-httpfrom 0.6.11 to 0.7.1 (published 2026-08-31). The owner wants every dependency on its latest version. The freshness check of 2026-11-15 (PR #36) held tower-http because reqwest 0.13.5 depends on tower-http 0.6.Lead decision: accept a temporary second copy of tower-http 0.6. reqwest 0.13.5 (the latest reqwest release) brings 0.6.11, and
deny.tomlonly warns on duplicate versions (multiple-versions = "warn"). reqwestmasteralready depends on tower-http 0.7.1 (seanmonstar/reqwest#3062, merged 2026-09-22).STACK.md§6 records the duplicate and the condition to remove it.Criteria
tower-http =0.7.1, the latest stable release.STACK.mdrecords the duplicate tower-http 0.6.11 and the condition to remove it: a reqwest release that depends on tower-http 0.7.mise run verifypasses on the PR head.Updates
tower-http(workspace, featurefs)tower-http0.6.11 (lockfile, through reqwest 0.13.5)cargo update --workspaceadds onlytower-http0.7.1. Every dependency of 0.7.1 is already inCargo.lock(http-range-header0.4.2 meets the new minimum of 0.4.2). Licence MIT;rust-version1.65.cargo tree -i tower-http@0.7.1: onlycaltodo.cargo tree -i tower-http@0.6.11: onlyreqwest0.13.5.How this repository uses tower-http
Cargo.toml:default-features = false, features = ["fs"].crates/server/src/http/static_files.rs:ServeDir::new(...)(withappend_index_html_on_directories(false)for the build root) andServeFile::new(...). The code calls them throughoneshot(Service::call), nevertry_call. No fallback, no precompression.follow-redirect). The 0.7 changes offollow-redirectdo not reach it until reqwest moves to 0.7.Changelog mapping
Source:
tower-http/CHANGELOG.mdonmain(read 2026-11-15) and the 0.7.1 source in the Cargo registry.0.7.1
fs:ServeDir::redirect_to_trailing_slash()(opt-in)append_index_html_on_directories(false)).fs:ignore_multi_range_requests()(opt-in; 416 stays the default)the_client_build_serves_one_byte_range.request-id:const fnconstructorsfs: minimumhttp-range-header0.4.2Cargo.lockalready has 0.4.2.ServeDir::try_callpropagates I/O errors without a fallbackService::call, which still maps a not-found I/O error to 404 and other errors to 500 (serve_dir/mod.rs,impl Service for ServeDir).found()treats 404 and 5xx as "not found" as before.decompression: two body end-of-stream fixesfs: a multipart range request is 416 withCannot serve multipart range requeststhe_client_build_serves_one_byte_range.fs: range error responses have no representation headersContent-Type(0.6.11 sent the file type,text/javascript; charset=utf-8).with_charsetthen adds nothing. New testthe_client_build_sends_no_content_type_on_a_416.set-header:Clonefor multiple-header types0.7.0
csrf: new CSRF middlewareapi_security.rs).timeout:DeadlineBody, body deadline layersfs: strongETag,If-Match,If-None-Match(RFC 9110); 304 carriesETagandLast-ModifiedETagfrom size and modification time, and a matchingIf-None-Matchis 304.index.htmlkeepsCache-Control: no-cache, so a browser revalidates it and gets 304 when it did not change. New testthe_client_build_sends_a_strong_etag. (2) A staleIf-Matchis now 412 with no body; 0.6.11 ignoredIf-Matchand sent 200 with the file. This applies to bundles,index.html, and the deep-link fallback (the fallback copies the request headers). Browsers do not sendIf-Matchon a page or bundle load. New teststhe_client_build_refuses_a_stale_if_match(bundle and/) anda_deep_link_refuses_a_stale_if_match(/settings). (3)If-None-Matchnow takes precedence overIf-Modified-Since(RFC 9110, section 13.2.2): a wrongIf-None-Matchwith a currentIf-Modified-Sinceis 200 with the file; 0.6.11 answered 304. New testthe_client_build_prefers_if_none_match_to_if_modified_since. (4) A 304 answer toIf-Modified-Sincenow carriesLast-Modified; 0.6.11 sent no validator on the 304. New testthe_client_build_sends_last_modified_on_a_304.found()passes 304 and 412 through. The module comment ofstatic_files.rsandSTACK.md§15 now say so.fs:Backendtrait,ServeDir::with_backend()ServeDir::newkeepsTokioBackend.fs:html_as_default_extension(opt-in)fs:redirect_path_prefix(opt-in)validate-request:has_header_value()body:UnsyncBoxBody::new(),From<ServeFileSystemResponseBody>into_response().limit:Defaultforlimit::ResponseBodycompressionwildcard andidentity;q=0handling,SizeAboveu64tokioandasync-compressionfeaturesfs.trace/classifygRPC changesfollow-redirectforwards extensions; cumulative filteringfollow-redirect, through its tower-http 0.6.11 copy. Reassess when reqwest moves to 0.7.trace: default callbacks parent their events to the request spancors: relaxedVarydefaultsfs:Vary: Accept-Encodingwith precompressed servingservicesreject a trailing slash for file paths (404)/assets/index-abc.js/and/favicon.png/are now 404 (0.6.11 served the file). A path such as/favicon.png/withAccept: text/htmlhas no extension in its last segment, so it now gets theindex.htmldeep-link fallback (200,no-cache), as any other deep link does; 0.6.11 served the favicon. Under/assetsthe answer stays 404. New teststhe_client_build_has_no_file_for_a_path_with_a_trailing_slashanda_file_path_with_a_trailing_slash_is_a_deep_link.STACK.md§15 now says so.fs:ServeDirno longer strips the file extension with identity encoding (#686)Accept-Encoding: identityalso without precompression and stripped the last extension:/assets/index-abc.js.mapservedindex-abc.jsand/index.html.bakservedindex.html(200). 0.7.1 keeps the whole name, so both are 404. New testthe_client_build_keeps_the_extension_with_identity_encoding.compression: trailers after compressiontrace,on-early-drop:on_eosand early-drop fixesset-header:Clonefor non-ClonebodiesBehaviour changes for this repository
ETag; a matchingIf-None-Matchis 304.If-Matchis 412 with no body, on bundles,index.html, and deep links (was 200).If-None-Matchwith a currentIf-Modified-Sinceis 200 (was 304).If-Modified-SincecarriesLast-Modified(was absent).Content-Type(was the file type).Accept-Encoding: identity, a name with an extra extension (index-abc.js.map,index.html.bak) is 404 (was the file without the last extension)./assets, and an HTML request getsindex.htmlelsewhere (was the file).Tests
New integration tests in
crates/server/tests/integration/api_security.rs(a temporary client build with one bundle,index.html, and a favicon):the_client_build_sends_a_strong_etag: a strongETagandLast-Modifiedon a bundle;If-None-Matchgives 304 with the sameETag;index.htmlrevalidates to 304 and keepsno-cache.the_client_build_refuses_a_stale_if_match:If-Match: "stale"on a bundle and on/gives 412 with an empty body. (Added after a note from the psstore review about tower-http #691.)the_client_build_has_no_file_for_a_path_with_a_trailing_slash:/assets/index-abc.js/and/favicon.png/are 404.the_client_build_serves_one_byte_range:bytes=0-6is 206 withconsole;bytes=0-1,4-5is 416. This test guards behaviour that did not change.Added in review round 1 (the reviewer's scratch tests were the reference):
the_client_build_prefers_if_none_match_to_if_modified_since:If-None-Match: "wrong"with the currentLast-ModifiedasIf-Modified-Sincegives 200 with the file.the_client_build_sends_last_modified_on_a_304:If-Modified-Sincewith the current value gives 304 with the sameLast-Modified.the_client_build_sends_no_content_type_on_a_416:Range: bytes=100-200on a 14-byte file gives 416 with noContent-Type.the_client_build_keeps_the_extension_with_identity_encoding:/assets/index-abc.js.mapand/index.html.bakwithAccept-Encoding: identityare 404.a_file_path_with_a_trailing_slash_is_a_deep_link:/favicon.png/withAccept: text/htmlgivesindex.htmlwithno-cache;/assets/index-abc.js/stays 404.a_deep_link_refuses_a_stale_if_match:/settingswithAccept: text/htmlandIf-Match: "stale"gives 412 with an empty body.Detection check (round 1, 2026-11-15): the eleven static-file tests ran against tower-http 0.6.11 (
Cargo.tomlandCargo.lockofmain, the new test file kept) withcargo nextest run --no-fail-fast. Nine fail and two pass:the_client_build_sends_a_strong_etagETagthe_client_build_refuses_a_stale_if_matcha_deep_link_refuses_a_stale_if_matchthe_client_build_prefers_if_none_match_to_if_modified_sincethe_client_build_sends_last_modified_on_a_304Last-Modifiedon the 304the_client_build_sends_no_content_type_on_a_416text/javascript; charset=utf-8, expected nonethe_client_build_keeps_the_extension_with_identity_encodingthe_client_build_has_no_file_for_a_path_with_a_trailing_slasha_file_path_with_a_trailing_slash_is_a_deep_linkindex.htmlthe_client_build_serves_one_byte_rangethe_client_build_serves_deep_links_but_not_api_pathsOn 0.7.1 all eleven pass.
Evidence
mise run verify: exit 0 on46d37e5(basemain2478fca; the PR head ismainplus three commits), macOS arm64, Rust 1.100.0, Node 26.13.1, Dockerpostgres:18(OrbStack), 2026-11-15 13:51–13:58 UTC. All steps passed: format check, lint,sqlx:check,contract:check, Gitleaks,pnpm audit,cargo deny(bans ok; it warns about the two tower-http versions, asdeny.tomlallows),cargo shear, build, nextest (208 tests), doctests, Vitest (19 + 4), and Playwright (67 journeys).git statusis clean after verify.46d37e5(13:42–13:46 UTC) passed every step up to Playwright (nextest 208/208), then stopped attest:e2e: port 47411 was in use by ane2e_serverof another agent's review checkout. The rerun above started after the port was free. No change between the two runs.mise run verifyexit 0 ond3a9e4a(201 tests) and on8894b30(202 tests). Review round 1 (FAIL) was on8894b30.chore(deps): update tower-http to 0.7.1,test(server): pin the stale If-Match answer of tower-http 0.7, andtest(server): pin six more file answers of tower-http 0.7.STACK.md§14).8894b30(missing tests, wrong #686 row). Round 2 is pending on46d37e5.Not verified
STACK.md§15 (headers, one SPA route) cover the merge. The productionETagdepends on the file modification times inside the Railpack image; a new image gives newETagvalues, andindex.htmlis revalidated in any case.Release
Railway deploys the merge. The release checks of
STACK.md§15 are pending until the owner merges.🤖 Generated with Claude Code