Repository navigation
fix: honor Range and If-Match on LFS snapshot requests - #447
Conversation
The LFS snapshot handler ignored the request's Range and validators unless the cache handed back an *os.File, so an interrupted download could not resume and had to start over. Serve it through the cache's conditional and range handling like the working-tree snapshot.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Disk wraps a ranged file in limitedReadCloser, which hid the file from net/http's sendfile path, so resumed downloads were copied through userspace. Hand ReadFrom the underlying LimitedReader instead.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4913974f22
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // TestDiskRangeReachesSendfile verifies a ranged disk read reaches ReadFrom as | ||
| // an *io.LimitedReader over the file, the only shape net's sendfile accepts. |
There was a problem hiding this comment.
Remove the documentation comment on the top-level test
The new comment on TestDiskRangeReachesSendfile violates the root AGENTS.md instruction, which explicitly prohibits comments on top-level tests. Remove this test documentation comment to comply with the repository's commenting convention.
AGENTS.md reference: AGENTS.md:L21-L22
Useful? React with 👍 / 👎.
The LFS snapshot handler ignored Range and the conditional headers unless the cache returned an *os.File, so S3-tier and backfilled responses always sent the full body and an interrupted download could not resume. Serve it through the cache's conditional and range handling, as the working-tree snapshot already does.
Ranged reads from the disk tier also go through sendfile now. The range wrapper hid the file from net/http, so both snapshot handlers copied resumed downloads through userspace.