Commit 876a960
authored
fix(cache): skip checksums for cached 404 entries (#35526)
Closes #35525.
## What changed
Cached 404 entries are now recognized before applying a content checksum
in the file fetcher cache path. The checksum is still applied to real
cached file bodies, but synthetic not-found metadata entries report
`NotFound` instead of trying to validate an empty body against a JSR
package manifest checksum.
## Why
JSR packages can contain dependency probes for extensionless Node
built-ins such as `crypto`, `fs`, or `path`. Those URLs are cached as
404 metadata entries. On a later run, the module graph can provide a
package-manifest checksum for the missing JSR subpath, which previously
caused the cached 404's empty body to fail integrity validation with
`Expected: package-manifest-missing-checksum`.
## Validation
- `cargo fmt -p deno_cache_dir`
- `cargo test -p deno_cache_dir
test_fetch_not_found_is_negatively_cached`
- `cargo test -p deno_cache_dir`
- `./tools/lint.js`
- End-to-end: first and second `cargo run --quiet --bin deno -- cache
jsr:@ts-morph/ts-morph@28.0.0` with the same temporary `DENO_DIR` both
exited 01 parent 8025886 commit 876a960
2 files changed
Lines changed: 37 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
719 | 719 | | |
720 | 720 | | |
721 | 721 | | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
722 | 747 | | |
723 | 748 | | |
724 | | - | |
725 | | - | |
726 | | - | |
727 | | - | |
728 | | - | |
729 | | - | |
730 | | - | |
731 | | - | |
732 | | - | |
733 | | - | |
734 | | - | |
735 | | - | |
736 | 749 | | |
737 | 750 | | |
738 | 751 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
399 | 400 | | |
400 | 401 | | |
401 | 402 | | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
402 | 414 | | |
403 | 415 | | |
404 | 416 | | |
| |||
0 commit comments